mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
Fix/refactor tcaches synchronization.
Synchronize tcaches with tcaches_mtx rather than ctl_mtx. Add missing
synchronization for tcache flushing. This bug was introduced by
1cb181ed63 (Implement explicit tcache
support.), which was first released in 4.0.0.
This commit is contained in:
@@ -2765,6 +2765,7 @@ _malloc_prefork(void)
|
||||
witness_prefork(tsd);
|
||||
/* Acquire all mutexes in a safe order. */
|
||||
ctl_prefork(tsd_tsdn(tsd));
|
||||
tcache_prefork(tsd_tsdn(tsd));
|
||||
malloc_mutex_prefork(tsd_tsdn(tsd), &arenas_lock);
|
||||
prof_prefork0(tsd_tsdn(tsd));
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -2825,6 +2826,7 @@ _malloc_postfork(void)
|
||||
}
|
||||
prof_postfork_parent(tsd_tsdn(tsd));
|
||||
malloc_mutex_postfork_parent(tsd_tsdn(tsd), &arenas_lock);
|
||||
tcache_postfork_parent(tsd_tsdn(tsd));
|
||||
ctl_postfork_parent(tsd_tsdn(tsd));
|
||||
}
|
||||
|
||||
@@ -2848,6 +2850,7 @@ jemalloc_postfork_child(void) {
|
||||
}
|
||||
prof_postfork_child(tsd_tsdn(tsd));
|
||||
malloc_mutex_postfork_child(tsd_tsdn(tsd), &arenas_lock);
|
||||
tcache_postfork_child(tsd_tsdn(tsd));
|
||||
ctl_postfork_child(tsd_tsdn(tsd));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user