mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-03 14:09:31 +03:00
print statistics nicer
This commit is contained in:
parent
02607f2b8d
commit
d48bafe2bb
1 changed files with 4 additions and 4 deletions
|
@ -215,7 +215,7 @@ static void mi_stat_counter_print_avg(const mi_stat_counter_t* stat, const char*
|
||||||
|
|
||||||
|
|
||||||
static void mi_print_header(mi_output_fun* out, void* arg ) {
|
static void mi_print_header(mi_output_fun* out, void* arg ) {
|
||||||
_mi_fprintf(out, arg, "%10s: %11s %11s %11s %11s %11s\n", "heap stats", "peak ", "total ", "current ", "unit ", "total# ");
|
_mi_fprintf(out, arg, "%10s: %11s %11s %11s %11s %11s\n", "heap stats", "peak ", "total ", "current ", "block ", "total# ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MI_STAT>1
|
#if MI_STAT>1
|
||||||
|
@ -284,10 +284,10 @@ static void _mi_stats_print(mi_stats_t* stats, mi_output_fun* out0, void* arg0)
|
||||||
// and print using that
|
// and print using that
|
||||||
mi_print_header(out,arg);
|
mi_print_header(out,arg);
|
||||||
#if MI_STAT>1
|
#if MI_STAT>1
|
||||||
mi_stats_print_bins(stats->malloc_bins, MI_BIN_HUGE, "normal",out,arg);
|
mi_stats_print_bins(stats->malloc_bins, MI_BIN_HUGE, "bin",out,arg);
|
||||||
#endif
|
#endif
|
||||||
#if MI_STAT
|
#if MI_STAT
|
||||||
mi_stat_print(&stats->malloc_normal, "normal", (stats->malloc_normal_count.total == 0 ? 1 : -1), out, arg);
|
mi_stat_print(&stats->malloc_normal, "binned", (stats->malloc_normal_count.total == 0 ? 1 : -1), out, arg);
|
||||||
mi_stat_print(&stats->malloc_huge, "huge", (stats->malloc_huge_count.total == 0 ? 1 : -1), out, arg);
|
mi_stat_print(&stats->malloc_huge, "huge", (stats->malloc_huge_count.total == 0 ? 1 : -1), out, arg);
|
||||||
mi_stat_count_t total = { 0,0,0 };
|
mi_stat_count_t total = { 0,0,0 };
|
||||||
mi_stat_count_add_mt(&total, &stats->malloc_normal);
|
mi_stat_count_add_mt(&total, &stats->malloc_normal);
|
||||||
|
@ -295,7 +295,7 @@ static void _mi_stats_print(mi_stats_t* stats, mi_output_fun* out0, void* arg0)
|
||||||
mi_stat_print_ex(&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_ex(&stats->malloc_requested, "malloc req", 1, out, arg, "");
|
mi_stat_peak_print(&stats->malloc_requested, "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, "");
|
||||||
|
|
Loading…
Add table
Reference in a new issue