[PATCH] Don't use pthread_atfork to register prefork/postfork handlers on OSX

Mike Hommey mh+jemalloc at glandium.org
Wed Mar 28 00:53:16 PDT 2012


From: Mike Hommey <mh at glandium.org>

OSX libc calls zone allocators' force_lock/force_unlock already.
---
 src/jemalloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/jemalloc.c b/src/jemalloc.c
index 38a511d..38ed641 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -575,7 +575,7 @@ malloc_init_hard(void)
 
 	malloc_conf_init();
 
-#ifndef JEMALLOC_MUTEX_INIT_CB
+#if (!defined(JEMALLOC_MUTEX_INIT_CB) && !defined(JEMALLOC_ZONE))
 	/* Register fork handlers. */
 	if (pthread_atfork(jemalloc_prefork, jemalloc_postfork_parent,
 	    jemalloc_postfork_child) != 0) {
-- 
1.7.9.1




More information about the jemalloc-discuss mailing list