From 483b1d7b8b8832b85c657d16863d2c7d19bc5d07 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 17 Sep 2020 17:40:19 -0400 Subject: [PATCH] empty malloc_info output when stats are disabled --- h_malloc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/h_malloc.c b/h_malloc.c index e55e263..2f3b5cf 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -1806,9 +1806,9 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) { return -1; } -#if CONFIG_STATS fputs("", fp); +#if CONFIG_STATS if (is_init()) { for (unsigned arena = 0; arena < N_ARENA; arena++) { fprintf(fp, "", arena); @@ -1845,14 +1845,11 @@ EXPORT int h_malloc_info(int options, UNUSED FILE *fp) { fprintf(fp, "%zu", region_allocated); fputs("", fp); } +#endif fputs("", fp); return 0; -#else - errno = ENOSYS; - return -1; -#endif } #endif