[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix memory-report--object-size for hashtable and vectors
From: |
Yikai Zhao |
Subject: |
[PATCH] Fix memory-report--object-size for hashtable and vectors |
Date: |
Sat, 14 Aug 2021 18:18:13 +0800 |
User-agent: |
Cyrus-JMAP/3.5.0-alpha0-1082-gccb13bca62-fm-ubox-20210811.001-gccb13bca |
Hi,
I'd like to send a simple patch to fix the `memory-report--object-size'
function in memory-report.el. Currently it did not give correct object size for
hashtable and vector objects, this patch fixes that.
I noticed this bug because when I did `memory-report', the result items in
"Largest Variables" list were unreasonably small and it did not match the
"Overall Object Memory Usage". With this patch, this should be solved.
To verify this, execute the following code:
(memory-report--object-size
(make-hash-table :test #'eq)
["long string that should be at least 40 bytes"])
The expected output should be a number greater than 40.
This is my first attempt to submit a patch to emacs, please let me know if
there's anything missing. Thanks!
Yikai
0001-Fix-memory-report-object-size-for-hashtable-and-vect.patch
Description: Text Data
- [PATCH] Fix memory-report--object-size for hashtable and vectors,
Yikai Zhao <=