Skip to content

Commit 3d7f3f0

Browse files
committed
py/gc: gc_dump_alloc_table(): Show byte/str and (byte)array objects.
These are typical consumers of large chunks of memory, so it's useful to see at least their number (how much memory isn't clearly shown, as the data for these objects is allocated elsewhere).
1 parent 80a8d47 commit 3d7f3f0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

py/gc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ void gc_dump_alloc_table(void) {
734734
if (*ptr == &mp_type_tuple) { c = 'T'; }
735735
else if (*ptr == &mp_type_list) { c = 'L'; }
736736
else if (*ptr == &mp_type_dict) { c = 'D'; }
737+
else if (*ptr == &mp_type_str || *ptr == &mp_type_bytes) { c = 'S'; }
738+
else if (*ptr == &mp_type_bytearray || *ptr == &mp_type_array) { c = 'A'; }
737739
#if MICROPY_PY_BUILTINS_FLOAT
738740
else if (*ptr == &mp_type_float) { c = 'F'; }
739741
#endif

0 commit comments

Comments
 (0)