summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/memory-report.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/memory-report.el')
-rw-r--r--lisp/emacs-lisp/memory-report.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/memory-report.el b/lisp/emacs-lisp/memory-report.el
index c88d9f2768a..b532ddc56c5 100644
--- a/lisp/emacs-lisp/memory-report.el
+++ b/lisp/emacs-lisp/memory-report.el
@@ -232,11 +232,11 @@ by counted more than once."
(defun memory-report--format (bytes)
(setq bytes (/ bytes 1024.0))
- (let ((units '("kB" "MB" "GB" "TB")))
+ (let ((units '("KiB" "MiB" "GiB" "TiB")))
(while (>= bytes 1024)
(setq bytes (/ bytes 1024.0))
(setq units (cdr units)))
- (format "%6.1f%s" bytes (car units))))
+ (format "%6.1f %s" bytes (car units))))
(defun memory-report--gc-elem (elems type)
(* (nth 1 (assq type elems))
@@ -294,7 +294,9 @@ by counted more than once."
(overlay-lists)))))
(defun memory-report--image-cache ()
- (list (cons "Total Image Cache Size" (image-cache-size))))
+ (list (cons "Total Image Cache Size" (if (fboundp 'image-cache-size)
+ (image-cache-size)
+ 0))))
(provide 'memory-report)