From 514a90bac346c87540ad7794219b32c3ca41e32d Mon Sep 17 00:00:00 2001 From: Michael Clark Date: Thu, 20 Jan 2022 19:35:14 +1300 Subject: [PATCH] histogram: guard _mi_histogram_print with #if MI_STAT>1 otherwise we end up printing a title without any histogram if stats are not enabled. --- src/init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/init.c b/src/init.c index 317e8bb9..e14c2dd8 100644 --- a/src/init.c +++ b/src/init.c @@ -543,9 +543,11 @@ static void mi_process_done(void) { if (mi_option_is_enabled(mi_option_show_stats) || mi_option_is_enabled(mi_option_verbose)) { mi_stats_print(NULL); } + #if MI_STAT>1 if (mi_option_is_enabled(mi_option_show_histogram)) { _mi_histogram_print(NULL); } + #endif mi_allocator_done(); _mi_verbose_message("process done: 0x%zx\n", _mi_heap_main.thread_id); os_preloading = true; // don't call the C runtime anymore