[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 93b144b: Pacify GCC on C library without glibc AP
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] emacs-25 93b144b: Pacify GCC on C library without glibc API |
Date: |
Sun, 31 Jan 2016 02:39:30 +0000 |
branch: emacs-25
commit 93b144bbaa4bcef356655613cf2fc4fa14e09df6
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Pacify GCC on C library without glibc API
Without this change, with --enable-gcc-warnings GCC would complain
“error: redundant redeclaration of ‘aligned_alloc’”.
* configure.ac: Simplify aligned_alloc testing.
* src/alloc.c (aligned_alloc): Don’t use if DARWIN_OS,
since the simplified configure.ac no longer checks for that.
Don’t declare if HAVE_ALIGNED_ALLOC.
Correct misspelling of HAVE_ALIGNED_ALLOC in ifdef.
---
configure.ac | 10 ++--------
src/alloc.c | 9 ++++++---
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5d6fcda..57bde94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3806,14 +3806,8 @@ getpwent endpwent getgrent endgrent \
cfmakeraw cfsetspeed copysign __executable_start log2)
LIBS=$OLD_LIBS
-dnl No need to check for aligned_alloc and posix_memalign if using
-dnl gmalloc.o, as it supplies them, unless we're using hybrid_malloc.
-dnl Don't use these functions on Darwin as they are incompatible with
-dnl unexmacosx.c.
-if (test -z "$GMALLOC_OBJ" || test "$hybrid_malloc" = yes) \
- && test "$opsys" != darwin; then
- AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
-fi
+dnl No need to check for posix_memalign if aligned_alloc works.
+AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
dnl Cannot use AC_CHECK_FUNCS
AC_CACHE_CHECK([for __builtin_unwind_init],
diff --git a/src/alloc.c b/src/alloc.c
index d379761..5f74d90 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1105,15 +1105,18 @@ lisp_free (void *block)
/* Use aligned_alloc if it or a simple substitute is available.
Address sanitization breaks aligned allocation, as of gcc 4.8.2 and
- clang 3.3 anyway. */
+ clang 3.3 anyway. Aligned allocation is incompatible with
+ unexmacosx.c, so don't use it on Darwin. */
-#if ! ADDRESS_SANITIZER
+#if ! ADDRESS_SANITIZER && ! DARWIN_OS
# if !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC && !defined
HYBRID_MALLOC
# define USE_ALIGNED_ALLOC 1
+# ifndef HAVE_ALIGNED_ALLOC
/* Defined in gmalloc.c. */
void *aligned_alloc (size_t, size_t);
+# endif
# elif defined HYBRID_MALLOC
-# if defined ALIGNED_ALLOC || defined HAVE_POSIX_MEMALIGN
+# if defined HAVE_ALIGNED_ALLOC || defined HAVE_POSIX_MEMALIGN
# define USE_ALIGNED_ALLOC 1
# define aligned_alloc hybrid_aligned_alloc
/* Defined in gmalloc.c. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 93b144b: Pacify GCC on C library without glibc API,
Paul Eggert <=