aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac10
-rw-r--r--src/alloc.c9
2 files changed, 8 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 5d6fcda86c4..57bde94d854 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3806,14 +3806,8 @@ getpwent endpwent getgrent endgrent \
3806cfmakeraw cfsetspeed copysign __executable_start log2) 3806cfmakeraw cfsetspeed copysign __executable_start log2)
3807LIBS=$OLD_LIBS 3807LIBS=$OLD_LIBS
3808 3808
3809dnl No need to check for aligned_alloc and posix_memalign if using 3809dnl No need to check for posix_memalign if aligned_alloc works.
3810dnl gmalloc.o, as it supplies them, unless we're using hybrid_malloc. 3810AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
3811dnl Don't use these functions on Darwin as they are incompatible with
3812dnl unexmacosx.c.
3813if (test -z "$GMALLOC_OBJ" || test "$hybrid_malloc" = yes) \
3814 && test "$opsys" != darwin; then
3815 AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
3816fi
3817 3811
3818dnl Cannot use AC_CHECK_FUNCS 3812dnl Cannot use AC_CHECK_FUNCS
3819AC_CACHE_CHECK([for __builtin_unwind_init], 3813AC_CACHE_CHECK([for __builtin_unwind_init],
diff --git a/src/alloc.c b/src/alloc.c
index d379761c168..5f74d9061e5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1105,15 +1105,18 @@ lisp_free (void *block)
1105 1105
1106/* Use aligned_alloc if it or a simple substitute is available. 1106/* Use aligned_alloc if it or a simple substitute is available.
1107 Address sanitization breaks aligned allocation, as of gcc 4.8.2 and 1107 Address sanitization breaks aligned allocation, as of gcc 4.8.2 and
1108 clang 3.3 anyway. */ 1108 clang 3.3 anyway. Aligned allocation is incompatible with
1109 unexmacosx.c, so don't use it on Darwin. */
1109 1110
1110#if ! ADDRESS_SANITIZER 1111#if ! ADDRESS_SANITIZER && ! DARWIN_OS
1111# if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC && !defined HYBRID_MALLOC 1112# if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC && !defined HYBRID_MALLOC
1112# define USE_ALIGNED_ALLOC 1 1113# define USE_ALIGNED_ALLOC 1
1114# ifndef HAVE_ALIGNED_ALLOC
1113/* Defined in gmalloc.c. */ 1115/* Defined in gmalloc.c. */
1114void *aligned_alloc (size_t, size_t); 1116void *aligned_alloc (size_t, size_t);
1117# endif
1115# elif defined HYBRID_MALLOC 1118# elif defined HYBRID_MALLOC
1116# if defined ALIGNED_ALLOC || defined HAVE_POSIX_MEMALIGN 1119# if defined HAVE_ALIGNED_ALLOC || defined HAVE_POSIX_MEMALIGN
1117# define USE_ALIGNED_ALLOC 1 1120# define USE_ALIGNED_ALLOC 1
1118# define aligned_alloc hybrid_aligned_alloc 1121# define aligned_alloc hybrid_aligned_alloc
1119/* Defined in gmalloc.c. */ 1122/* Defined in gmalloc.c. */