diff options
| author | Paul Eggert | 2016-11-20 16:57:17 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-11-20 16:59:24 -0800 |
| commit | 0b187fd2bfb797e113626df1b3740edbda8b698a (patch) | |
| tree | bb0d96996a2058c644d829350cafe61263f3c51a /src/alloc.c | |
| parent | ebe2e69c8fb14dfa169e0497cd868ade79d4c9d8 (diff) | |
| download | emacs-0b187fd2bfb797e113626df1b3740edbda8b698a.tar.gz emacs-0b187fd2bfb797e113626df1b3740edbda8b698a.zip | |
Make CANNOT_DUMP work better on GNU/Linux
Clean up some of the bitrot affecting the CANNOT_DUMP code. This
lets the build succeed again, and fixes the testing framework so
that most test cases now pass. About twenty test cases still
fail, though, and we still have Bug#24974.
* configure.ac (CANNOT_DUMP): Now empty if CANNOT_DUMP.
(SYSTEM_MALLOC): Now true if CANNOT_DUMP. There should no longer
be any point to messing with a private memory allocator unless
Emacs is dumping.
* src/alloc.c (alloc_unexec_pre, alloc_unexec_post, check_pure_size):
* src/image.c (reset_image_types):
* src/lastfile.c (my_endbss, _my_endbss, my_endbss_static):
Do not define if CANNOT_DUMP.
* src/emacs.c (might_dump) [CANNOT_DUMP]: Now always false and local.
(daemon_pipe) [!WINDOWSNT]: Now static.
* test/Makefile.in (mostlyclean): Remove *.tmp files.
(make-test-deps.mk): Elide CANNOT_DUMP chatter.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c index 90c6f9441fa..175dcab2487 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -173,31 +173,34 @@ voidfuncptr __MALLOC_HOOK_VOLATILE __malloc_initialize_hook EXTERNALLY_VISIBLE | |||
| 173 | 173 | ||
| 174 | #endif | 174 | #endif |
| 175 | 175 | ||
| 176 | #if defined DOUG_LEA_MALLOC || !defined CANNOT_DUMP | ||
| 177 | |||
| 176 | /* Allocator-related actions to do just before and after unexec. */ | 178 | /* Allocator-related actions to do just before and after unexec. */ |
| 177 | 179 | ||
| 178 | void | 180 | void |
| 179 | alloc_unexec_pre (void) | 181 | alloc_unexec_pre (void) |
| 180 | { | 182 | { |
| 181 | #ifdef DOUG_LEA_MALLOC | 183 | # ifdef DOUG_LEA_MALLOC |
| 182 | malloc_state_ptr = malloc_get_state (); | 184 | malloc_state_ptr = malloc_get_state (); |
| 183 | if (!malloc_state_ptr) | 185 | if (!malloc_state_ptr) |
| 184 | fatal ("malloc_get_state: %s", strerror (errno)); | 186 | fatal ("malloc_get_state: %s", strerror (errno)); |
| 185 | #endif | 187 | # endif |
| 186 | #ifdef HYBRID_MALLOC | 188 | # ifdef HYBRID_MALLOC |
| 187 | bss_sbrk_did_unexec = true; | 189 | bss_sbrk_did_unexec = true; |
| 188 | #endif | 190 | # endif |
| 189 | } | 191 | } |
| 190 | 192 | ||
| 191 | void | 193 | void |
| 192 | alloc_unexec_post (void) | 194 | alloc_unexec_post (void) |
| 193 | { | 195 | { |
| 194 | #ifdef DOUG_LEA_MALLOC | 196 | # ifdef DOUG_LEA_MALLOC |
| 195 | free (malloc_state_ptr); | 197 | free (malloc_state_ptr); |
| 196 | #endif | 198 | # endif |
| 197 | #ifdef HYBRID_MALLOC | 199 | # ifdef HYBRID_MALLOC |
| 198 | bss_sbrk_did_unexec = false; | 200 | bss_sbrk_did_unexec = false; |
| 199 | #endif | 201 | # endif |
| 200 | } | 202 | } |
| 203 | #endif | ||
| 201 | 204 | ||
| 202 | /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer | 205 | /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer |
| 203 | to a struct Lisp_String. */ | 206 | to a struct Lisp_String. */ |
| @@ -5216,6 +5219,8 @@ pure_alloc (size_t size, int type) | |||
| 5216 | } | 5219 | } |
| 5217 | 5220 | ||
| 5218 | 5221 | ||
| 5222 | #ifndef CANNOT_DUMP | ||
| 5223 | |||
| 5219 | /* Print a warning if PURESIZE is too small. */ | 5224 | /* Print a warning if PURESIZE is too small. */ |
| 5220 | 5225 | ||
| 5221 | void | 5226 | void |
| @@ -5226,6 +5231,7 @@ check_pure_size (void) | |||
| 5226 | " bytes needed)"), | 5231 | " bytes needed)"), |
| 5227 | pure_bytes_used + pure_bytes_used_before_overflow); | 5232 | pure_bytes_used + pure_bytes_used_before_overflow); |
| 5228 | } | 5233 | } |
| 5234 | #endif | ||
| 5229 | 5235 | ||
| 5230 | 5236 | ||
| 5231 | /* Find the byte sequence {DATA[0], ..., DATA[NBYTES-1], '\0'} from | 5237 | /* Find the byte sequence {DATA[0], ..., DATA[NBYTES-1], '\0'} from |