summaryrefslogtreecommitdiffstats
path: root/src/prof.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2012-10-16 17:40:57 (GMT)
committerJason Evans <jasone@canonware.com>2012-10-16 17:40:57 (GMT)
commit3b1f3aca54fede23299cde9034f7b909c3d290d7 (patch)
tree9915372dbfc04d5c086143570d74ac704a2eb736 /src/prof.c
parentfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046 (diff)
parent2b592b0f0bd043c0d14f8923f3c16009e5e312d5 (diff)
downloadjemalloc-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.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/prof.c b/src/prof.c
index de1d392..04964ef 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -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);
+ }
+}
+
/******************************************************************************/