summaryrefslogtreecommitdiffstats
path: root/src/jemalloc.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-11-17 23:14:57 (GMT)
committerJason Evans <jasone@canonware.com>2016-11-17 23:14:57 (GMT)
commit5234be21333e341252ed7223570d790970694d80 (patch)
tree900e27ea83ea6eee24cc227024da84aefb4cf977 /src/jemalloc.c
parentfda60be799e7929191f3844dd55b685549b6d867 (diff)
downloadjemalloc-5234be21333e341252ed7223570d790970694d80.zip
jemalloc-5234be21333e341252ed7223570d790970694d80.tar.gz
jemalloc-5234be21333e341252ed7223570d790970694d80.tar.bz2
Add pthread_atfork(3) feature test.
Some versions of Android provide a pthreads library without providing pthread_atfork(), so in practice a separate feature test is necessary for the latter.
Diffstat (limited to 'src/jemalloc.c')
-rw-r--r--src/jemalloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c
index 2c405b7..7df3fc9 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -1264,8 +1264,9 @@ malloc_init_hard_recursible(void)
ncpus = malloc_ncpus();
-#if (!defined(JEMALLOC_MUTEX_INIT_CB) && !defined(JEMALLOC_ZONE) \
- && !defined(_WIN32) && !defined(__native_client__))
+#if (defined(JEMALLOC_HAVE_PTHREAD_ATFORK) && !defined(JEMALLOC_MUTEX_INIT_CB) \
+ && !defined(JEMALLOC_ZONE) && !defined(_WIN32) && \
+ !defined(__native_client__))
/* LinuxThreads' pthread_atfork() allocates. */
if (pthread_atfork(jemalloc_prefork, jemalloc_postfork_parent,
jemalloc_postfork_child) != 0) {