aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPip Cet2024-08-20 18:31:05 +0000
committerStefan Kangas2024-12-12 22:48:11 +0100
commit15e2b14f03796467fab8e8086d293a5813afaa5b (patch)
treeb0e390cbc89b67c617799019694bf92e4bd78ccc /src/alloc.c
parent7ce34a3bcf5ed277ef37aa75e1ccbd858543b6cf (diff)
downloademacs-15e2b14f03796467fab8e8086d293a5813afaa5b.tar.gz
emacs-15e2b14f03796467fab8e8086d293a5813afaa5b.zip
Unexec removal: Main part
* configure.ac: Remove unexec-specific parts. (EMACS_CONFIG_FEATURES): Always report that we do not have the UNEXEC feature. (AC_ECHO): No longer display a line about the unexec feature. * lisp/loadup.el: * lisp/startup.el: Remove unexec-specific code. * src/Makefile.in (base_obj): Drop 'UNEXEC_OBJ'. * src/alloc.c (staticvec): Never initialize this variable. (BLOCK_ALIGN): Always allow large blocks. (mmap_lisp_allowed_p): Remove unexec-specific code. * src/buffer.c (init_buffer): * src/conf_post.h (ADDRESS_SANITIZER): * src/emacs.c (load_pdump, main): Remove unexec-specific code. (Fdump_emacs): Remove function. (syms_of_emacs): Remove 'Fdump_emacs'. * src/lastfile.c: Remove unexec-specific code. * src/lisp.h (gflags): Remove unexec-specific flags. (will_dump_p, will_bootstrap_p, will_dump_with_unexec_p) (dumped_with_unexec_p, definitely_will_not_unexec_p): Remove or adjust predicates. (SUBR_SECTION_ATTRIBUTE): Remove unexec-specific definition. * src/pdumper.c (Fdump_emacs_portable): Remove unexec-specific warning. * src/process.c (init_process_emacs): Remove !unexec condition * src/sysdep.c (maybe_disable_address_randomization): Adjust comment. (init_signals): * src/timefns.c (init_timefns): Remove unexec-specific code. * src/w32heap.c (report_temacs_memory_usage): Remove function. * src/w32heap.h: Adjust comment. * src/w32image.c (globals_of_w32image): Remove unexec-specific code.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 4fab0d54248..eb2e9fae783 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -266,7 +266,7 @@ voidfuncptr __MALLOC_HOOK_VOLATILE __malloc_initialize_hook EXTERNALLY_VISIBLE
266 266
267#endif 267#endif
268 268
269#if defined DOUG_LEA_MALLOC || defined HAVE_UNEXEC 269#if defined DOUG_LEA_MALLOC
270 270
271/* Allocator-related actions to do just before and after unexec. */ 271/* Allocator-related actions to do just before and after unexec. */
272 272
@@ -570,15 +570,9 @@ static void mem_delete (struct mem_node *);
570static void mem_delete_fixup (struct mem_node *); 570static void mem_delete_fixup (struct mem_node *);
571static struct mem_node *mem_find (void *); 571static struct mem_node *mem_find (void *);
572 572
573/* Addresses of staticpro'd variables. Initialize it to a nonzero 573/* Addresses of staticpro'd variables. */
574 value if we might unexec; otherwise some compilers put it into
575 BSS. */
576 574
577Lisp_Object const *staticvec[NSTATICS] 575Lisp_Object const *staticvec[NSTATICS];
578#ifdef HAVE_UNEXEC
579= {&Vpurify_flag}
580#endif
581 ;
582 576
583/* Index of next unused slot in staticvec. */ 577/* Index of next unused slot in staticvec. */
584 578
@@ -631,10 +625,8 @@ mmap_lisp_allowed_p (void)
631{ 625{
632 /* If we can't store all memory addresses in our lisp objects, it's 626 /* If we can't store all memory addresses in our lisp objects, it's
633 risky to let the heap use mmap and give us addresses from all 627 risky to let the heap use mmap and give us addresses from all
634 over our address space. We also can't use mmap for lisp objects 628 over our address space. */
635 if we might dump: unexec doesn't preserve the contents of mmapped 629 return pointers_fit_in_lispobj_p ();
636 regions. */
637 return pointers_fit_in_lispobj_p () && !will_dump_with_unexec_p ();
638} 630}
639#endif 631#endif
640 632
@@ -1071,11 +1063,7 @@ lisp_free (void *block)
1071 BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */ 1063 BLOCK_BYTES and guarantees they are aligned on a BLOCK_ALIGN boundary. */
1072 1064
1073/* Byte alignment of storage blocks. */ 1065/* Byte alignment of storage blocks. */
1074#ifdef HAVE_UNEXEC
1075# define BLOCK_ALIGN (1 << 10)
1076#else /* !HAVE_UNEXEC */
1077# define BLOCK_ALIGN (1 << 15) 1066# define BLOCK_ALIGN (1 << 15)
1078#endif
1079static_assert (POWER_OF_2 (BLOCK_ALIGN)); 1067static_assert (POWER_OF_2 (BLOCK_ALIGN));
1080 1068
1081/* Use aligned_alloc if it or a simple substitute is available. 1069/* Use aligned_alloc if it or a simple substitute is available.