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.
This commit is contained in:
Michael Clark 2022-01-20 19:35:14 +13:00
parent 109ff12cd5
commit 514a90bac3
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 6BF1D7B357EF3E4F

View file

@ -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)) { if (mi_option_is_enabled(mi_option_show_stats) || mi_option_is_enabled(mi_option_verbose)) {
mi_stats_print(NULL); mi_stats_print(NULL);
} }
#if MI_STAT>1
if (mi_option_is_enabled(mi_option_show_histogram)) { if (mi_option_is_enabled(mi_option_show_histogram)) {
_mi_histogram_print(NULL); _mi_histogram_print(NULL);
} }
#endif
mi_allocator_done(); mi_allocator_done();
_mi_verbose_message("process done: 0x%zx\n", _mi_heap_main.thread_id); _mi_verbose_message("process done: 0x%zx\n", _mi_heap_main.thread_id);
os_preloading = true; // don't call the C runtime anymore os_preloading = true; // don't call the C runtime anymore