[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MPS symbols
From: |
Eli Zaretskii |
Subject: |
Re: MPS symbols |
Date: |
Fri, 28 Jun 2024 19:06:47 +0300 |
> From: Helmut Eller <eller.helmut@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> Date: Fri, 28 Jun 2024 17:41:42 +0200
>
> Not quite. The size must be a multiple of the word size. This seems to
> work:
>
>
> >From acba908affb92090785fbf77360d5d84ce4b14f9 Mon Sep 17 00:00:00 2001
> From: Helmut Eller <eller.helmut@gmail.com>
> 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)];
I don't understand why you moved the definition of puresize[] from
alloc.c to puresize.h. If we need the same definition in two source
files, and you don't want to repeat it more than once, just do the
arithmetics in puresize.h and leave the definition simple, like this:
EMACS_INT pure[pure_size];
where pure_size is computed in puresize.h.
Having dimension in an extern declaration in a header file is at least
unusual, if not unportable.
- Re: MPS symbols, (continued)
- Re: MPS symbols, Eli Zaretskii, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28
- Re: MPS symbols, Helmut Eller, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28
- Re: MPS symbols, Helmut Eller, 2024/06/28
- Re: MPS symbols,
Eli Zaretskii <=
- Re: MPS symbols, Helmut Eller, 2024/06/28
- Re: MPS symbols, Eli Zaretskii, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28
- Re: MPS symbols, Eli Zaretskii, 2024/06/28
- Re: MPS symbols, Gerd Möllmann, 2024/06/28