1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 14:30:50 -08:00

* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Simplify

This commit is contained in:
Stefan Monnier 2021-04-12 12:55:52 -04:00
parent be75b08f82
commit c42dc493d1

View file

@ -182,7 +182,7 @@ by counted more than once."
(cl-defmethod memory-report--object-size-1 (_ (value symbol))
;; Don't count global symbols -- makes sizes of lists of symbols too
;; heavey.
;; heavy.
(if (intern-soft value obarray)
0
(memory-report--size 'symbol)))
@ -214,14 +214,14 @@ by counted more than once."
(setf (gethash value counted) t)
(when (car value)
(cl-incf total (memory-report--object-size counted (car value))))
(if (cdr value)
(if (consp (cdr value))
(if (gethash (cdr value) counted)
(setq value nil)
(setq value (cdr value)))
(cl-incf total (memory-report--object-size counted (cdr value)))
(setq value nil))
(setq value nil)))
(let ((next (cdr value)))
(setq value (when next
(if (consp next)
(unless (gethash next counted)
(cdr value))
(cl-incf total (memory-report--object-size
counted next))
nil)))))
total))
(cl-defmethod memory-report--object-size-1 (counted (value vector))