aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c22
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
178void 180void
179alloc_unexec_pre (void) 181alloc_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
191void 193void
192alloc_unexec_post (void) 194alloc_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
5221void 5226void
@@ -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