diff options
author | Jason Evans <je@fb.com> | 2011-03-19 02:30:18 (GMT) |
---|---|---|
committer | Jason Evans <je@fb.com> | 2011-03-19 02:30:18 (GMT) |
commit | 893a0ed7c8c11962524ba6f2adeb304d038be2a9 (patch) | |
tree | f3250f735a97587da8ca61f0208f07bc28cd65fe /jemalloc/configure.ac | |
parent | 763baa6cfcc8a9df9d3b7f676b2193ac7cd5ef51 (diff) | |
download | jemalloc-893a0ed7c8c11962524ba6f2adeb304d038be2a9.zip jemalloc-893a0ed7c8c11962524ba6f2adeb304d038be2a9.tar.gz jemalloc-893a0ed7c8c11962524ba6f2adeb304d038be2a9.tar.bz2 |
Use OSSpinLock*() for locking on OS X.
pthread_mutex_lock() can call malloc() on OS X (!!!), which causes
deadlock. Work around this by using spinlocks that are built of more
primitive stuff.
Diffstat (limited to 'jemalloc/configure.ac')
-rw-r--r-- | jemalloc/configure.ac | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/jemalloc/configure.ac b/jemalloc/configure.ac index c40d22f..412d3d1 100644 --- a/jemalloc/configure.ac +++ b/jemalloc/configure.ac @@ -793,6 +793,21 @@ if test "x${osatomic}" = "xyes" ; then fi dnl ============================================================================ +dnl Check for spinlock(3) operations as provided on Darwin. + +JE_COMPILABLE([Darwin OSSpin*()], [ +#include <libkern/OSAtomic.h> +#include <inttypes.h> +], [ + OSSpinLock lock = 0; + OSSpinLockLock(&lock); + OSSpinLockUnlock(&lock); +], [osspin]) +if test "x${osspin}" = "xyes" ; then + AC_DEFINE([JEMALLOC_OSSPIN]) +fi + +dnl ============================================================================ dnl Check for allocator-related functions that should be wrapped. AC_CHECK_FUNC([memalign], |