Use file-size-human-readable in memory-report--format
* lisp/emacs-lisp/memory-report.el (memory-report--format): Use file-size-human-readable.
This commit is contained in:
parent
f5c6e628ed
commit
8300899953
1 changed files with 1 additions and 6 deletions
|
@ -262,12 +262,7 @@ by counted more than once."
|
||||||
(cl-struct-slot-info struct-type)))))
|
(cl-struct-slot-info struct-type)))))
|
||||||
|
|
||||||
(defun memory-report--format (bytes)
|
(defun memory-report--format (bytes)
|
||||||
(setq bytes (/ bytes 1024.0))
|
(format "%10s" (file-size-human-readable bytes 'iec " ")))
|
||||||
(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))))
|
|
||||||
|
|
||||||
(defun memory-report--gc-elem (elems type)
|
(defun memory-report--gc-elem (elems type)
|
||||||
(* (nth 1 (assq type elems))
|
(* (nth 1 (assq type elems))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue