From 06c79dcfcbc634325b688385be95cd5ed049e208 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 26 May 2022 13:04:50 +0200 Subject: [PATCH] Make memory-report not bug out with symbols with positions * lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Don't bug out when there are symbols with positions. --- lisp/emacs-lisp/memory-report.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el index 6cb4cb02e0c..56b1ea6ed48 100644 --- a/lisp/emacs-lisp/memory-report.el +++ b/lisp/emacs-lisp/memory-report.el @@ -183,6 +183,10 @@ by counted more than once." (cl-defgeneric memory-report--object-size-1 (_counted _value) 0) +;; This shouldn't happen, but there's some leakage. +(cl-defmethod memory-report--object-size-1 (_ (_value symbol-with-pos)) + (memory-report--size 'symbol)) + (cl-defmethod memory-report--object-size-1 (_ (value symbol)) ;; Don't count global symbols -- makes sizes of lists of symbols too ;; heavy. -- 2.39.2