Stats: Fix tcache_bytes reporting.

Previously, large allocations in tcaches would have their sizes reduced during
stats estimation.  Added a test, which fails before this change but passes now.

This fixes a bug introduced in 5934846612, which
was itself fixing a bug introduced in 9c0549007d.
This commit is contained in:
David Goldblatt
2020-03-12 12:42:10 -07:00
committed by David Goldblatt
parent a5780598b3
commit 2e5899c129
2 changed files with 52 additions and 2 deletions

View File

@@ -207,7 +207,8 @@ arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
cache_bin_t *tbin = &descriptor->bins_large[i];
arena_stats_accum_zu(&astats->tcache_bytes,
cache_bin_ncached_get(tbin,
&tcache_bin_info[i + SC_NBINS]) * sz_index2size(i));
&tcache_bin_info[i + SC_NBINS])
* sz_index2size(i + SC_NBINS));
}
}
malloc_mutex_prof_read(tsdn,