This should help insulate Emacs better from configuration screwups.
Future versions of the GNU C library are planned to deprecate
these functions, but will continue to support them in
already-built-and-dumped Emacs executables.
* src/alloc.c (malloc_initialize_hook) [DOUG_LEA_MALLOC]:
Abort if malloc_set_state fails.
(alloc_unexec_pre) [DOUG_LEA_MALLOC]:
Report malloc_get_state failure, and exit.
#include <config.h>
+#include <errno.h>
#include <stdio.h>
#include <limits.h> /* For CHAR_BIT. */
#include <signal.h> /* For SIGABRT, SIGDANGER. */
}
}
- malloc_set_state (malloc_state_ptr);
+ if (malloc_set_state (malloc_state_ptr) != 0)
+ emacs_abort ();
# ifndef XMALLOC_OVERRUN_CHECK
alloc_unexec_post ();
# endif
{
#ifdef DOUG_LEA_MALLOC
malloc_state_ptr = malloc_get_state ();
+ if (!malloc_state_ptr)
+ fatal ("malloc_get_state: %s", strerror (errno));
#endif
#ifdef HYBRID_MALLOC
bss_sbrk_did_unexec = true;