MCPcopy Create free account
hub / github.com/F-Stack/f-stack / jemalloc_postfork_parent

Function jemalloc_postfork_parent

app/redis-6.2.6/deps/jemalloc/src/jemalloc.c:3262–3297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3260
3261#ifndef JEMALLOC_MUTEX_INIT_CB
3262void
3263jemalloc_postfork_parent(void)
3264#else
3265JEMALLOC_EXPORT void
3266_malloc_postfork(void)
3267#endif
3268{
3269 tsd_t *tsd;
3270 unsigned i, narenas;
3271
3272#ifdef JEMALLOC_MUTEX_INIT_CB
3273 if (!malloc_initialized()) {
3274 return;
3275 }
3276#endif
3277 assert(malloc_initialized());
3278
3279 tsd = tsd_fetch();
3280
3281 witness_postfork_parent(tsd_witness_tsdp_get(tsd));
3282 /* Release all mutexes, now that fork() has completed. */
3283 for (i = 0, narenas = narenas_total_get(); i < narenas; i++) {
3284 arena_t *arena;
3285
3286 if ((arena = arena_get(tsd_tsdn(tsd), i, false)) != NULL) {
3287 arena_postfork_parent(tsd_tsdn(tsd), arena);
3288 }
3289 }
3290 prof_postfork_parent(tsd_tsdn(tsd));
3291 if (have_background_thread) {
3292 background_thread_postfork_parent(tsd_tsdn(tsd));
3293 }
3294 malloc_mutex_postfork_parent(tsd_tsdn(tsd), &arenas_lock);
3295 tcache_postfork_parent(tsd_tsdn(tsd));
3296 ctl_postfork_parent(tsd_tsdn(tsd));
3297}
3298
3299void
3300jemalloc_postfork_child(void) {

Callers 1

zone_force_unlockFunction · 0.85

Calls 12

malloc_initializedFunction · 0.85
tsd_fetchFunction · 0.85
witness_postfork_parentFunction · 0.85
narenas_total_getFunction · 0.85
arena_getFunction · 0.85
tsd_tsdnFunction · 0.85
arena_postfork_parentFunction · 0.85
prof_postfork_parentFunction · 0.85
tcache_postfork_parentFunction · 0.85
ctl_postfork_parentFunction · 0.85

Tested by

no test coverage detected