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

Function jemalloc_postfork_child

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

Source from the content-addressed store, hash-verified

3297}
3298
3299void
3300jemalloc_postfork_child(void) {
3301 tsd_t *tsd;
3302 unsigned i, narenas;
3303
3304 assert(malloc_initialized());
3305
3306 tsd = tsd_fetch();
3307
3308 witness_postfork_child(tsd_witness_tsdp_get(tsd));
3309 /* Release all mutexes, now that fork() has completed. */
3310 for (i = 0, narenas = narenas_total_get(); i < narenas; i++) {
3311 arena_t *arena;
3312
3313 if ((arena = arena_get(tsd_tsdn(tsd), i, false)) != NULL) {
3314 arena_postfork_child(tsd_tsdn(tsd), arena);
3315 }
3316 }
3317 prof_postfork_child(tsd_tsdn(tsd));
3318 if (have_background_thread) {
3319 background_thread_postfork_child(tsd_tsdn(tsd));
3320 }
3321 malloc_mutex_postfork_child(tsd_tsdn(tsd), &arenas_lock);
3322 tcache_postfork_child(tsd_tsdn(tsd));
3323 ctl_postfork_child(tsd_tsdn(tsd));
3324}
3325
3326/******************************************************************************/
3327

Callers 1

zone_force_unlockFunction · 0.85

Calls 12

malloc_initializedFunction · 0.85
tsd_fetchFunction · 0.85
witness_postfork_childFunction · 0.85
narenas_total_getFunction · 0.85
arena_getFunction · 0.85
tsd_tsdnFunction · 0.85
arena_postfork_childFunction · 0.85
prof_postfork_childFunction · 0.85
tcache_postfork_childFunction · 0.85
ctl_postfork_childFunction · 0.85

Tested by

no test coverage detected