summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-01-16 17:34:45 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2019-01-16 17:35:11 -0800
commit978cf88bda9c9b41f1cc20cf8e53a9e6caeb91be (patch)
tree53fa8498c48011d69b004ee9b0982280fe8465c2 /src/alloc.c
parent191a5568db35f3a56f26431ca4722175d38c684f (diff)
downloademacs-978cf88bda9c9b41f1cc20cf8e53a9e6caeb91be.tar.gz
Port pdumper to older GNU/Linux
Problem reported by Colin Baxter in: https://lists.gnu.org/r/emacs-devel/2019-01/msg00321.html * src/alloc.c (my_heap_start): Also define if GNU_LINUX && CANNOT_DUMP && DOUG_LEA_MALLOC.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 8054aa5ae59..5ea466becae 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -103,24 +103,12 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "w32heap.h" /* for sbrk */
#endif
-#if defined GNU_LINUX && !defined CANNOT_DUMP
-/* The address where the heap starts. */
-void *
-my_heap_start (void)
-{
- static void *start;
- if (! start)
- start = sbrk (0);
- return start;
-}
-#endif
-
#ifdef DOUG_LEA_MALLOC
/* Specify maximum number of areas to mmap. It would be nice to use a
value that explicitly means "no limit". */
-#define MMAP_MAX_AREAS 100000000
+# define MMAP_MAX_AREAS 100000000
/* A pointer to the memory allocated that copies that static data
inside glibc's malloc. */
@@ -136,9 +124,9 @@ malloc_initialize_hook (void)
if (! initialized)
{
-#ifdef GNU_LINUX
+# ifdef GNU_LINUX
my_heap_start ();
-#endif
+# endif
malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;
}
else
@@ -201,6 +189,20 @@ alloc_unexec_post (void)
free (malloc_state_ptr);
# endif
}
+
+# ifdef GNU_LINUX
+
+/* The address where the heap starts. */
+void *
+my_heap_start (void)
+{
+ static void *start;
+ if (! start)
+ start = sbrk (0);
+ return start;
+}
+# endif
+
#endif
/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer