diff options
author | jackpoz <giacomopoz@gmail.com> | 2014-03-12 20:53:34 +0100 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2014-03-28 22:34:39 +0100 |
commit | a3e56b06897b1768f52cc3ecbf7a9b836228fe19 (patch) | |
tree | dcc681418db3efccba5513c1ff0b82d1b2b6cebc /dep/jemalloc/src/tcache.c | |
parent | f7659e5c1ac8e3fbc1ec17c69775877cb3482ac4 (diff) |
Core/Dependencies: Upgrade to jemalloc-3.5.1
Diffstat (limited to 'dep/jemalloc/src/tcache.c')
-rw-r--r-- | dep/jemalloc/src/tcache.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/dep/jemalloc/src/tcache.c b/dep/jemalloc/src/tcache.c index 98ed19edd52..6de92960b2d 100644 --- a/dep/jemalloc/src/tcache.c +++ b/dep/jemalloc/src/tcache.c @@ -260,8 +260,8 @@ tcache_arena_dissociate(tcache_t *tcache) /* Unlink from list of extant tcaches. */ malloc_mutex_lock(&tcache->arena->lock); ql_remove(&tcache->arena->tcache_ql, tcache, link); - malloc_mutex_unlock(&tcache->arena->lock); tcache_stats_merge(tcache, tcache->arena); + malloc_mutex_unlock(&tcache->arena->lock); } } @@ -292,7 +292,7 @@ tcache_create(arena_t *arena) else if (size <= tcache_maxclass) tcache = (tcache_t *)arena_malloc_large(arena, size, true); else - tcache = (tcache_t *)icallocx(size, false, arena); + tcache = (tcache_t *)icalloct(size, false, arena); if (tcache == NULL) return (NULL); @@ -366,7 +366,7 @@ tcache_destroy(tcache_t *tcache) arena_dalloc_large(arena, chunk, tcache); } else - idallocx(tcache, false); + idalloct(tcache, false); } void @@ -399,11 +399,14 @@ tcache_thread_cleanup(void *arg) } } +/* Caller must own arena->lock. */ void tcache_stats_merge(tcache_t *tcache, arena_t *arena) { unsigned i; + cassert(config_stats); + /* Merge and reset tcache stats. */ for (i = 0; i < NBINS; i++) { arena_bin_t *bin = &arena->bins[i]; |