summaryrefslogtreecommitdiffstats
path: root/src/tcache.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-01-13 23:22:16 (GMT)
committerQi Wang <interwq@gmail.com>2017-01-17 17:42:39 (GMT)
commite8990dc7c7b3083ce05823e581780c2b22f5cbbb (patch)
tree3e7b82a2a508d24f0eb44c5a0efab44f4ede30fe /src/tcache.c
parentffbb7dac3d669697ab8b39367994a58e0c1fa42d (diff)
downloadjemalloc-e8990dc7c7b3083ce05823e581780c2b22f5cbbb.zip
jemalloc-e8990dc7c7b3083ce05823e581780c2b22f5cbbb.tar.gz
jemalloc-e8990dc7c7b3083ce05823e581780c2b22f5cbbb.tar.bz2
Remove redundent stats-merging logic when destroying tcache.
The removed stats merging logic is already taken care of by tcache_flush.
Diffstat (limited to 'src/tcache.c')
-rw-r--r--src/tcache.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/tcache.c b/src/tcache.c
index 66e255d..d132341 100644
--- a/src/tcache.c
+++ b/src/tcache.c
@@ -357,11 +357,8 @@ tcache_destroy(tsd_t *tsd, tcache_t *tcache)
tcache_bin_t *tbin = &tcache->tbins[i];
tcache_bin_flush_small(tsd, tcache, tbin, i, 0);
- if (config_stats && tbin->tstats.nrequests != 0) {
- arena_bin_t *bin = &arena->bins[i];
- malloc_mutex_lock(tsd_tsdn(tsd), &bin->lock);
- bin->stats.nrequests += tbin->tstats.nrequests;
- malloc_mutex_unlock(tsd_tsdn(tsd), &bin->lock);
+ if (config_stats) {
+ assert(tbin->tstats.nrequests == 0);
}
}
@@ -369,12 +366,8 @@ tcache_destroy(tsd_t *tsd, tcache_t *tcache)
tcache_bin_t *tbin = &tcache->tbins[i];
tcache_bin_flush_large(tsd, tbin, i, 0, tcache);
- if (config_stats && tbin->tstats.nrequests != 0) {
- malloc_mutex_lock(tsd_tsdn(tsd), &arena->lock);
- arena->stats.nrequests_large += tbin->tstats.nrequests;
- arena->stats.lstats[i - NBINS].nrequests +=
- tbin->tstats.nrequests;
- malloc_mutex_unlock(tsd_tsdn(tsd), &arena->lock);
+ if (config_stats) {
+ assert(tbin->tstats.nrequests == 0);
}
}