Fix large bin index accessed through cache bin descriptor.
This commit is contained in:
parent
22746d3c9f
commit
5934846612
@ -199,13 +199,12 @@ arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
|
|||||||
malloc_mutex_lock(tsdn, &arena->tcache_ql_mtx);
|
malloc_mutex_lock(tsdn, &arena->tcache_ql_mtx);
|
||||||
cache_bin_array_descriptor_t *descriptor;
|
cache_bin_array_descriptor_t *descriptor;
|
||||||
ql_foreach(descriptor, &arena->cache_bin_array_descriptor_ql, link) {
|
ql_foreach(descriptor, &arena->cache_bin_array_descriptor_ql, link) {
|
||||||
szind_t i = 0;
|
for (szind_t i = 0; i < SC_NBINS; i++) {
|
||||||
for (; i < SC_NBINS; i++) {
|
|
||||||
cache_bin_t *tbin = &descriptor->bins_small[i];
|
cache_bin_t *tbin = &descriptor->bins_small[i];
|
||||||
arena_stats_accum_zu(&astats->tcache_bytes,
|
arena_stats_accum_zu(&astats->tcache_bytes,
|
||||||
tbin->ncached * sz_index2size(i));
|
tbin->ncached * sz_index2size(i));
|
||||||
}
|
}
|
||||||
for (; i < nhbins; i++) {
|
for (szind_t i = 0; i < nhbins - SC_NBINS; i++) {
|
||||||
cache_bin_t *tbin = &descriptor->bins_large[i];
|
cache_bin_t *tbin = &descriptor->bins_large[i];
|
||||||
arena_stats_accum_zu(&astats->tcache_bytes,
|
arena_stats_accum_zu(&astats->tcache_bytes,
|
||||||
tbin->ncached * sz_index2size(i));
|
tbin->ncached * sz_index2size(i));
|
||||||
|
Loading…
Reference in New Issue
Block a user