summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-09-12 18:38:13 (GMT)
committerQi Wang <interwq@gmail.com>2017-09-12 23:16:12 (GMT)
commit9b20a4bf70efd675604985ca37335f8b0136a289 (patch)
tree342bcf445cda71b87bbe8330e9db0220b2e03f48 /src
parent886053b966f4108e4b9ee5e29a0a708e91bc72f8 (diff)
downloadjemalloc-9b20a4bf70efd675604985ca37335f8b0136a289.zip
jemalloc-9b20a4bf70efd675604985ca37335f8b0136a289.tar.gz
jemalloc-9b20a4bf70efd675604985ca37335f8b0136a289.tar.bz2
Clear cache bin ql postfork.
This fixes a regression in 9c05490, which introduced the new cache bin ql. The list needs to be cleaned up after fork, same as tcache_ql.
Diffstat (limited to 'src')
-rw-r--r--src/arena.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/arena.c b/src/arena.c
index 18ed5aa..43ba601 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -1936,6 +1936,7 @@ arena_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks) {
}
ql_new(&arena->tcache_ql);
+ ql_new(&arena->cache_bin_array_descriptor_ql);
if (malloc_mutex_init(&arena->tcache_ql_mtx, "tcache_ql",
WITNESS_RANK_TCACHE_QL, malloc_mutex_rank_exclusive)) {
goto label_error;
@@ -2155,10 +2156,16 @@ arena_postfork_child(tsdn_t *tsdn, arena_t *arena) {
}
if (config_stats) {
ql_new(&arena->tcache_ql);
+ ql_new(&arena->cache_bin_array_descriptor_ql);
tcache_t *tcache = tcache_get(tsdn_tsd(tsdn));
if (tcache != NULL && tcache->arena == arena) {
ql_elm_new(tcache, link);
ql_tail_insert(&arena->tcache_ql, tcache, link);
+ cache_bin_array_descriptor_init(
+ &tcache->cache_bin_array_descriptor,
+ tcache->bins_small, tcache->bins_large);
+ ql_tail_insert(&arena->cache_bin_array_descriptor_ql,
+ &tcache->cache_bin_array_descriptor, link);
}
}