| 3891 | } |
| 3892 | |
| 3893 | void |
| 3894 | jemalloc_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 |
no test coverage detected