aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
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/>. */
103#include "w32heap.h" /* for sbrk */ 103#include "w32heap.h" /* for sbrk */
104#endif 104#endif
105 105
106#if defined GNU_LINUX && !defined CANNOT_DUMP
107/* The address where the heap starts. */
108void *
109my_heap_start (void)
110{
111 static void *start;
112 if (! start)
113 start = sbrk (0);
114 return start;
115}
116#endif
117
118#ifdef DOUG_LEA_MALLOC 106#ifdef DOUG_LEA_MALLOC
119 107
120/* Specify maximum number of areas to mmap. It would be nice to use a 108/* Specify maximum number of areas to mmap. It would be nice to use a
121 value that explicitly means "no limit". */ 109 value that explicitly means "no limit". */
122 110
123#define MMAP_MAX_AREAS 100000000 111# define MMAP_MAX_AREAS 100000000
124 112
125/* A pointer to the memory allocated that copies that static data 113/* A pointer to the memory allocated that copies that static data
126 inside glibc's malloc. */ 114 inside glibc's malloc. */
@@ -136,9 +124,9 @@ malloc_initialize_hook (void)
136 124
137 if (! initialized) 125 if (! initialized)
138 { 126 {
139#ifdef GNU_LINUX 127# ifdef GNU_LINUX
140 my_heap_start (); 128 my_heap_start ();
141#endif 129# endif
142 malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL; 130 malloc_using_checking = getenv ("MALLOC_CHECK_") != NULL;
143 } 131 }
144 else 132 else
@@ -201,6 +189,20 @@ alloc_unexec_post (void)
201 free (malloc_state_ptr); 189 free (malloc_state_ptr);
202# endif 190# endif
203} 191}
192
193# ifdef GNU_LINUX
194
195/* The address where the heap starts. */
196void *
197my_heap_start (void)
198{
199 static void *start;
200 if (! start)
201 start = sbrk (0);
202 return start;
203}
204# endif
205
204#endif 206#endif
205 207
206/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer 208/* Mark, unmark, query mark bit of a Lisp string. S must be a pointer