MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / jemalloc_postfork_child

Function jemalloc_postfork_child

deps/jemalloc/src/jemalloc.c:3893–3920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3891}
3892
3893void
3894jemalloc_postfork_child(void) {
3895 tsd_t *tsd;
3896 unsigned i, narenas;
3897
3898 assert(malloc_initialized());
3899
3900 tsd = tsd_fetch();
3901
3902 tsd_postfork_child(tsd);
3903
3904 witness_postfork_child(tsd_witness_tsdp_get(tsd));
3905 /* Release all mutexes, now that fork() has completed. */
3906 for (i = 0, narenas = narenas_total_get(); i < narenas; i++) {
3907 arena_t *arena;
3908
3909 if ((arena = arena_get(tsd_tsdn(tsd), i, false)) != NULL) {
3910 arena_postfork_child(tsd_tsdn(tsd), arena);
3911 }
3912 }
3913 prof_postfork_child(tsd_tsdn(tsd));
3914 if (have_background_thread) {
3915 background_thread_postfork_child(tsd_tsdn(tsd));
3916 }
3917 malloc_mutex_postfork_child(tsd_tsdn(tsd), &arenas_lock);
3918 tcache_postfork_child(tsd_tsdn(tsd));
3919 ctl_postfork_child(tsd_tsdn(tsd));
3920}
3921
3922/******************************************************************************/
3923

Callers 1

zone_force_unlockFunction · 0.70

Calls 13

tsd_postfork_childFunction · 0.85
malloc_initializedFunction · 0.70
witness_postfork_childFunction · 0.70
narenas_total_getFunction · 0.70
arena_postfork_childFunction · 0.70
prof_postfork_childFunction · 0.70
tcache_postfork_childFunction · 0.70
ctl_postfork_childFunction · 0.70
tsd_fetchFunction · 0.50
arena_getFunction · 0.50

Tested by

no test coverage detected