mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-18 04:14:23 -05:00
add is_init check to malloc_info
This commit is contained in:
parent
9fb2791af2
commit
50e0f1334c
@ -1800,6 +1800,8 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) {
|
||||
|
||||
#if CONFIG_STATS
|
||||
fputs("<malloc version=\"hardened_malloc-1\">", fp);
|
||||
|
||||
if (is_init()) {
|
||||
for (unsigned arena = 0; arena < N_ARENA; arena++) {
|
||||
fprintf(fp, "<heap nr=\"%u\">", arena);
|
||||
|
||||
@ -1841,6 +1843,7 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) {
|
||||
fprintf(fp, "<heap nr=\"%u\">", N_ARENA);
|
||||
fprintf(fp, "<allocated_large>%zu</allocated_large>", region_allocated);
|
||||
fputs("</heap>", fp);
|
||||
}
|
||||
|
||||
fputs("</malloc>", fp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user