From acba908affb92090785fbf77360d5d84ce4b14f9 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Fri, 28 Jun 2024 17:32:08 +0200 Subject: [PATCH] Fir pure root size again * src/puresize.h (root): Specify array bounds. * src/igc.c (root_create_pure): Use the size of the type. * src/array.c (root): Simplify. --- src/alloc.c | 2 +- src/igc.c | 4 ++-- src/puresize.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 80701ae1b38..31cb86e6d0e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -394,7 +394,7 @@ #define SPARE_MEMORY (1 << 14) space (pure), on some systems. We have not implemented the remapping on more recent systems because this is less important nowadays than in the days of small memories and timesharing. */ -EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,}; +EMACS_INT pure[] = {1,}; #define PUREBEG (char *) pure diff --git a/src/igc.c b/src/igc.c index aa7c6150aeb..77dd20d64e3 100644 --- a/src/igc.c +++ b/src/igc.c @@ -2359,8 +2359,8 @@ root_create_charset_table (struct igc *gc) static void root_create_pure (struct igc *gc) { - char *start = (char *) &pure[0]; - char *end = start + PURESIZE; + void *start = &pure; + void *end = &pure + 1; root_create (gc, start, end, mps_rank_ambig (), scan_pure, NULL, true, "pure"); } diff --git a/src/puresize.h b/src/puresize.h index 4f15dcb6665..a09e60504a8 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -79,7 +79,8 @@ #define PURESIZE (BASE_PURESIZE * PURESIZE_RATIO * PURESIZE_CHECKING_RATIO) extern AVOID pure_write_error (Lisp_Object); -extern EMACS_INT pure[]; +extern EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) + / sizeof (EMACS_INT)]; /* The puresize_h_* macros are private to this include file. */ -- 2.39.2