aboutsummaryrefslogtreecommitdiffstats
path: root/src/gmalloc.c
diff options
context:
space:
mode:
authorEli Zaretskii2021-05-20 11:26:00 +0300
committerEli Zaretskii2021-05-20 11:26:00 +0300
commitb2eed2ae568b53ac910f4a3b8458eedf8d8c67ec (patch)
treebff25c6d02605018e916b904ef77454812ca0f64 /src/gmalloc.c
parentd68f2b8681f8eeb6bbf1b4476a88f00b2962179e (diff)
downloademacs-b2eed2ae568b53ac910f4a3b8458eedf8d8c67ec.tar.gz
emacs-b2eed2ae568b53ac910f4a3b8458eedf8d8c67ec.zip
Clean up the fix for unexec build on GNU/Linux
* src/conf_post.h [HYBRID_MALLOC || DARWIN_OS && HAVE_UNEXEC]: Include <stdlib.h> here, before redirecting 'malloc' and friends to their hybrid_* and unexec_* equivalents. #undef malloc and friends before redefining. Provide prototypes for the replacements. Suggested by Paul Eggert <eggert@cs.ucla.edu>. * src/gmalloc.c [HYBRID_MALLOC]: Remove declarations of 'malloc' and friends, as they are now redundant: we include <stdlib.h> in conf_post.h before redefining 'malloc' etc., and that provides prototypes from system headers. * configure.ac (HYBRID_MALLOC): Remove kludge to avoid replacement of 'free' by Gnulib. (Bug#36649)
Diffstat (limited to 'src/gmalloc.c')
-rw-r--r--src/gmalloc.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 66008ea69b2..dedd25fa22f 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1690,16 +1690,6 @@ valloc (size_t size)
1690#undef free 1690#undef free
1691 1691
1692#ifdef HYBRID_MALLOC 1692#ifdef HYBRID_MALLOC
1693/* Declare system malloc and friends. */
1694extern void *malloc (size_t size);
1695extern void *realloc (void *ptr, size_t size);
1696extern void *calloc (size_t nmemb, size_t size);
1697extern void free (void *ptr);
1698#ifdef HAVE_ALIGNED_ALLOC
1699extern void *aligned_alloc (size_t alignment, size_t size);
1700#elif defined HAVE_POSIX_MEMALIGN
1701extern int posix_memalign (void **memptr, size_t alignment, size_t size);
1702#endif
1703 1693
1704/* Assuming PTR was allocated via the hybrid malloc, return true if 1694/* Assuming PTR was allocated via the hybrid malloc, return true if
1705 PTR was allocated via gmalloc, not the system malloc. Also, return 1695 PTR was allocated via gmalloc, not the system malloc. Also, return