summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/memory-report.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2021-01-02 10:11:15 +0100
committerAndrea Corallo <akrl@sdf.org>2021-01-02 10:11:15 +0100
commit5db5064395c251a822e429e19ddecb74a974b6ef (patch)
tree2e04729a03d5fc68d0caef3a16e00349b6d413fc /lisp/emacs-lisp/memory-report.el
parent9420ea6e0840bffcb140d3677dfdabb9251c1f63 (diff)
parent0f561ee55348ff451600cc6027db5940ee14606f (diff)
downloademacs-5db5064395c251a822e429e19ddecb74a974b6ef.tar.gz
emacs-5db5064395c251a822e429e19ddecb74a974b6ef.tar.bz2
emacs-5db5064395c251a822e429e19ddecb74a974b6ef.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/emacs-lisp/memory-report.el')
-rw-r--r--lisp/emacs-lisp/memory-report.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el
index 332749987c4..3d6ca957e63 100644
--- a/lisp/emacs-lisp/memory-report.el
+++ b/lisp/emacs-lisp/memory-report.el
@@ -1,6 +1,6 @@
;;; memory-report.el --- Short function summaries -*- lexical-binding: t -*-
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
;; Keywords: lisp, help
@@ -48,6 +48,7 @@ by counted more than once."
(message "Gathering data...")
(let ((reports (append (memory-report--garbage-collect)
(memory-report--image-cache)
+ (memory-report--symbol-plist)
(memory-report--buffers)
(memory-report--largest-variables)))
(inhibit-read-only t)
@@ -159,6 +160,17 @@ by counted more than once."
"\n"))
(buffer-string)))))
+(defun memory-report--symbol-plist ()
+ (let ((counted (make-hash-table :test #'eq))
+ (total 0))
+ (mapatoms
+ (lambda (symbol)
+ (cl-incf total (memory-report--object-size
+ counted (symbol-plist symbol))))
+ obarray)
+ (list
+ (cons "Memory Used By Symbol Plists" total))))
+
(defun memory-report--object-size (counted value)
(if (gethash value counted)
0