diff options
author | Jason Evans <jasone@canonware.com> | 2012-10-16 17:40:57 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2012-10-16 17:40:57 (GMT) |
commit | 3b1f3aca54fede23299cde9034f7b909c3d290d7 (patch) | |
tree | 9915372dbfc04d5c086143570d74ac704a2eb736 /src/prof.c | |
parent | fc9b1dbf69f59d7ecfc4ac68da9847e017e1d046 (diff) | |
parent | 2b592b0f0bd043c0d14f8923f3c16009e5e312d5 (diff) | |
download | jemalloc-3b1f3aca54fede23299cde9034f7b909c3d290d7.zip jemalloc-3b1f3aca54fede23299cde9034f7b909c3d290d7.tar.gz jemalloc-3b1f3aca54fede23299cde9034f7b909c3d290d7.tar.bz2 |
Merge branch 'dev'3.1.0
Diffstat (limited to 'src/prof.c')
-rw-r--r-- | src/prof.c | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -1270,4 +1270,46 @@ prof_boot2(void) return (false); } +void +prof_prefork(void) +{ + + if (opt_prof) { + unsigned i; + + malloc_mutex_lock(&bt2ctx_mtx); + malloc_mutex_lock(&prof_dump_seq_mtx); + for (i = 0; i < PROF_NCTX_LOCKS; i++) + malloc_mutex_lock(&ctx_locks[i]); + } +} + +void +prof_postfork_parent(void) +{ + + if (opt_prof) { + unsigned i; + + for (i = 0; i < PROF_NCTX_LOCKS; i++) + malloc_mutex_postfork_parent(&ctx_locks[i]); + malloc_mutex_postfork_parent(&prof_dump_seq_mtx); + malloc_mutex_postfork_parent(&bt2ctx_mtx); + } +} + +void +prof_postfork_child(void) +{ + + if (opt_prof) { + unsigned i; + + for (i = 0; i < PROF_NCTX_LOCKS; i++) + malloc_mutex_postfork_child(&ctx_locks[i]); + malloc_mutex_postfork_child(&prof_dump_seq_mtx); + malloc_mutex_postfork_child(&bt2ctx_mtx); + } +} + /******************************************************************************/ |