Fix a bug in nmalloc stats.

This commit is contained in:
Jason Evans 2010-02-12 14:46:37 -08:00
parent 65aae2cf57
commit f894f74d36

View File

@ -1076,12 +1076,10 @@ arena_tcache_fill(arena_t *arena, tcache_bin_t *tbin, size_t binind
bin->stats.nfills++;
bin->stats.nrequests += tbin->tstats.nrequests;
if (bin->reg_size <= small_maxclass) {
arena->stats.nmalloc_small += (i - tbin->ncached);
arena->stats.allocated_small += (i - tbin->ncached) *
bin->reg_size;
arena->stats.nmalloc_small += tbin->tstats.nrequests;
} else {
arena->stats.nmalloc_medium += (i - tbin->ncached);
arena->stats.allocated_medium += (i - tbin->ncached) *
bin->reg_size;
arena->stats.nmalloc_medium += tbin->tstats.nrequests;