diff options
| author | Paul Eggert | 2019-01-16 17:34:45 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-01-16 17:35:11 -0800 |
| commit | 978cf88bda9c9b41f1cc20cf8e53a9e6caeb91be (patch) | |
| tree | 53fa8498c48011d69b004ee9b0982280fe8465c2 /src | |
| parent | 191a5568db35f3a56f26431ca4722175d38c684f (diff) | |
| download | emacs-978cf88bda9c9b41f1cc20cf8e53a9e6caeb91be.tar.gz emacs-978cf88bda9c9b41f1cc20cf8e53a9e6caeb91be.zip | |
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')
| -rw-r--r-- | src/alloc.c | 32 |
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. */ | ||
| 108 | void * | ||
| 109 | my_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. */ | ||
| 196 | void * | ||
| 197 | my_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 |