diff options
| author | Stefan Kangas | 2024-12-10 11:07:01 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2024-12-12 22:48:20 +0100 |
| commit | 892be3b3d7a459808ee47709d0f4e7f65566a6e5 (patch) | |
| tree | cdd1af74019f556f76abd4fbf9ce3073238091ba /src/alloc.c | |
| parent | bb64e9464c584bace441f60678b80f41ddc6e2a3 (diff) | |
| download | emacs-892be3b3d7a459808ee47709d0f4e7f65566a6e5.tar.gz emacs-892be3b3d7a459808ee47709d0f4e7f65566a6e5.zip | |
Remove check for working malloc_set_state
This check was added to 'malloc_initialize_hook' in order to "insulate
Emacs better from configuration screwups" (commit b4788b9394f3). With
unexec gone, we no longer use 'malloc_set_state', and thus don't need
this check.
Note that this patch removes the last uses of the deprecated glibc
functions 'malloc_set_state' and 'malloc_get_state' from our code.
* src/alloc.c (malloc_initialize_hook) [DOUG_LEA_MALLOC]:
Remove check for working 'malloc_set_state'.
(alloc_unexec_pre) [DOUG_LEA_MALLOC]: Delete unused function.
(alloc_unexec_post) [DOUG_LEA_MALLOC]: Delete function.
(malloc_state_ptr) [DOUG_LEA_MALLOC]: Delete variable.
* configure.ac (emacs_cv_var_doug_lea_malloc): Don't check for
malloc_set_state and malloc_get_state.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/alloc.c b/src/alloc.c index e557e82883c..1e0e5f58e84 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -209,10 +209,6 @@ enum { MALLOC_ALIGNMENT = max (2 * sizeof (size_t), alignof (long double)) }; | |||
| 209 | 209 | ||
| 210 | # define MMAP_MAX_AREAS 100000000 | 210 | # define MMAP_MAX_AREAS 100000000 |
| 211 | 211 | ||
| 212 | /* A pointer to the memory allocated that copies that static data | ||
| 213 | inside glibc's malloc. */ | ||
| 214 | static void *malloc_state_ptr; | ||
| 215 | |||
| 216 | /* Restore the dumped malloc state. Because malloc can be invoked | 212 | /* Restore the dumped malloc state. Because malloc can be invoked |
| 217 | even before main (e.g. by the dynamic linker), the dumped malloc | 213 | even before main (e.g. by the dynamic linker), the dumped malloc |
| 218 | state must be restored as early as possible using this special hook. */ | 214 | state must be restored as early as possible using this special hook. */ |
| @@ -247,10 +243,6 @@ malloc_initialize_hook (void) | |||
| 247 | break; | 243 | break; |
| 248 | } | 244 | } |
| 249 | } | 245 | } |
| 250 | |||
| 251 | if (malloc_set_state (malloc_state_ptr) != 0) | ||
| 252 | emacs_abort (); | ||
| 253 | alloc_unexec_post (); | ||
| 254 | } | 246 | } |
| 255 | } | 247 | } |
| 256 | 248 | ||
| @@ -266,27 +258,6 @@ voidfuncptr __MALLOC_HOOK_VOLATILE __malloc_initialize_hook EXTERNALLY_VISIBLE | |||
| 266 | #endif | 258 | #endif |
| 267 | 259 | ||
| 268 | #if defined DOUG_LEA_MALLOC | 260 | #if defined DOUG_LEA_MALLOC |
| 269 | |||
| 270 | /* Allocator-related actions to do just before and after unexec. */ | ||
| 271 | |||
| 272 | void | ||
| 273 | alloc_unexec_pre (void) | ||
| 274 | { | ||
| 275 | # ifdef DOUG_LEA_MALLOC | ||
| 276 | malloc_state_ptr = malloc_get_state (); | ||
| 277 | if (!malloc_state_ptr) | ||
| 278 | fatal ("malloc_get_state: %s", strerror (errno)); | ||
| 279 | # endif | ||
| 280 | } | ||
| 281 | |||
| 282 | void | ||
| 283 | alloc_unexec_post (void) | ||
| 284 | { | ||
| 285 | # ifdef DOUG_LEA_MALLOC | ||
| 286 | free (malloc_state_ptr); | ||
| 287 | # endif | ||
| 288 | } | ||
| 289 | |||
| 290 | # ifdef GNU_LINUX | 261 | # ifdef GNU_LINUX |
| 291 | 262 | ||
| 292 | /* The address where the heap starts. */ | 263 | /* The address where the heap starts. */ |