1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

memory-report: support calculating size for structures

* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Add
support for cl-defstruct types (bug#50301).
This commit is contained in:
Yikai Zhao 2021-09-02 09:37:06 +02:00 committed by Lars Ingebrigtsen
parent 891be6f140
commit d8d5dc4565
2 changed files with 22 additions and 1 deletions

View file

@ -68,6 +68,14 @@
(vector string string))
124))))
(ert-deftest memory-report-sizes-structs ()
(cl-defstruct memory-report-test-struct
(item0 nil)
(item1 nil))
(let ((s (make-memory-report-test-struct :item0 "hello" :item1 "world")))
(should (= (memory-report-object-size s)
90))))
(provide 'memory-report-tests)
;;; memory-report-tests.el ends here