| 3297 | } |
| 3298 | |
| 3299 | void |
| 3300 | jemalloc_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 |
no test coverage detected