mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-01-06 05:07:56 -05:00
empty malloc_info output when stats are disabled
This commit is contained in:
parent
96eca21ac5
commit
483b1d7b8b
@ -1806,9 +1806,9 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CONFIG_STATS
|
|
||||||
fputs("<malloc version=\"hardened_malloc-1\">", fp);
|
fputs("<malloc version=\"hardened_malloc-1\">", fp);
|
||||||
|
|
||||||
|
#if CONFIG_STATS
|
||||||
if (is_init()) {
|
if (is_init()) {
|
||||||
for (unsigned arena = 0; arena < N_ARENA; arena++) {
|
for (unsigned arena = 0; arena < N_ARENA; arena++) {
|
||||||
fprintf(fp, "<heap nr=\"%u\">", arena);
|
fprintf(fp, "<heap nr=\"%u\">", arena);
|
||||||
@ -1845,14 +1845,11 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) {
|
|||||||
fprintf(fp, "<allocated_large>%zu</allocated_large>", region_allocated);
|
fprintf(fp, "<allocated_large>%zu</allocated_large>", region_allocated);
|
||||||
fputs("</heap>", fp);
|
fputs("</heap>", fp);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
fputs("</malloc>", fp);
|
fputs("</malloc>", fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
|
||||||
errno = ENOSYS;
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user