nicer stats

This commit is contained in:
Daan Leijen 2025-03-01 19:46:01 -08:00
parent 4d727ee6e6
commit bc5f636c5e
2 changed files with 10 additions and 10 deletions

View file

@ -664,7 +664,7 @@ static void mi_segment_free(mi_segment_t* segment, bool force, mi_segments_tld_t
mi_assert_expensive(!mi_segment_queue_contains(&tld->medium_free, segment)); mi_assert_expensive(!mi_segment_queue_contains(&tld->medium_free, segment));
mi_assert(segment->next == NULL); mi_assert(segment->next == NULL);
mi_assert(segment->prev == NULL); mi_assert(segment->prev == NULL);
_mi_stat_decrease(&tld->stats->page_committed, segment->segment_info_size); // _mi_stat_decrease(&tld->stats->page_committed, segment->segment_info_size);
// return it to the OS // return it to the OS
mi_segment_os_free(segment, segment->segment_size, tld); mi_segment_os_free(segment, segment->segment_size, tld);

View file

@ -309,17 +309,17 @@ static void _mi_stats_print(mi_stats_t* stats, mi_output_fun* out0, void* arg0)
mi_stat_count_t total = { 0,0,0 }; mi_stat_count_t total = { 0,0,0 };
mi_stat_add(&total, &stats->normal); mi_stat_add(&total, &stats->normal);
mi_stat_add(&total, &stats->huge); mi_stat_add(&total, &stats->huge);
mi_stat_print(&total, "total", 1, out, arg); mi_stat_print_ex(&total, "total", 1, out, arg, "");
#endif #endif
#if MI_STAT>1 #if MI_STAT>1
mi_stat_print(&stats->malloc, "malloc req", 1, out, arg); mi_stat_print_ex(&stats->malloc, "malloc req", 1, out, arg, "");
_mi_fprintf(out, arg, "\n"); _mi_fprintf(out, arg, "\n");
#endif #endif
mi_stat_print_ex(&stats->reserved, "reserved", 1, out, arg, ""); mi_stat_print_ex(&stats->reserved, "reserved", 1, out, arg, "");
mi_stat_print_ex(&stats->committed, "committed", 1, out, arg, ""); mi_stat_print_ex(&stats->committed, "committed", 1, out, arg, "");
mi_stat_peak_print(&stats->reset, "reset", 1, out, arg ); mi_stat_peak_print(&stats->reset, "reset", 1, out, arg );
mi_stat_peak_print(&stats->purged, "purged", 1, out, arg ); mi_stat_peak_print(&stats->purged, "purged", 1, out, arg );
mi_stat_print(&stats->page_committed, "touched", 1, out, arg); mi_stat_print_ex(&stats->page_committed, "touched", 1, out, arg, "");
mi_stat_print(&stats->segments, "segments", -1, out, arg); mi_stat_print(&stats->segments, "segments", -1, out, arg);
mi_stat_print(&stats->segments_abandoned, "-abandoned", -1, out, arg); mi_stat_print(&stats->segments_abandoned, "-abandoned", -1, out, arg);
mi_stat_print(&stats->segments_cache, "-cached", -1, out, arg); mi_stat_print(&stats->segments_cache, "-cached", -1, out, arg);