unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: eller.helmut@gmail.com,  emacs-devel@gnu.org
Subject: Re: MPS image cache
Date: Sun, 05 May 2024 11:31:23 +0200	[thread overview]
Message-ID: <m2fruw8v10.fsf@pro2.fritz.box> (raw)
In-Reply-To: <86ikzseipz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 May 2024 12:00:40 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> Pushed that, but not yet using it. We can always remove that later...
>
> It breaks the 32-bit build:
>
>   In file included from lisp.h:42,
> 		   from igc.c:32:
>   igc.c: In function 'fix_ptr_vec':
>   ../lib/verify.h:213:41: error: static assertion failed: "verify (sizeof *h == sizeof *v)"
>     213 | # define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC)
> 	|                                         ^~~~~~~~~~~~~~
>   ../lib/verify.h:330:20: note: in expansion of macro '_GL_VERIFY'
>     330 | # define verify(R) _GL_VERIFY (R, "verify (" #R ")", -)
> 	|                    ^~~~~~~~~~
>   igc.c:107:30: note: in expansion of macro 'verify'
>     107 | #define igc_static_assert(x) verify (x)
> 	|                              ^~~~~~
>   igc.c:1085:5: note: in expansion of macro 'igc_static_assert'
>    1085 |     igc_static_assert (sizeof *h == sizeof *v);
> 	|     ^~~~~~~~~~~~~~~~~
>   Makefile:453: recipe for target `igc.o' failed
>
> And I truly don't understand how it was supposed to work:
>
>   static mps_res_t
>   fix_ptr_vec (mps_ss_t ss, void *client)
>   {
>     MPS_SCAN_BEGIN (ss)
>     {
>       struct igc_header *h = client_to_base (client);
>       void **v = client;
>       igc_static_assert (sizeof *h == sizeof *v);  <<<<<<<<<<<<<<<<<
>
> Here '*v' is a pointer, whereas '*h' is 'struct igc_header', which is
> a structure whose size is larger than 32 bits:

I guess this comes from igc_header being 1 word on 64 bit, and 2 on
32-bit. Thing is we need to know how large the vector is to scan it.
We have the info the igc_header::nwords.

>   enum
>   {
>     IGC_TYPE_BITS = 5,
>     IGC_PVEC_BITS = 6,
>     IGC_HASH_BITS = 21,
>     IGC_SIZE_BITS = 32
>   };
>
>   struct igc_header
>   {
>     enum igc_obj_type obj_type : IGC_TYPE_BITS;
>     enum pvec_type pvec_type : IGC_PVEC_BITS;
>     mps_word_t hash : IGC_HASH_BITS;
>     mps_word_t nwords : IGC_SIZE_BITS;
>   };
>
> So this can only work on a 64-bit architecture, and even then only if
> the compiler packs the structure (which is entirely not guaranteed
> AFAIK).  Or what am I missing here?

Apparently it only works as is on 64-bits and so on. What do you expect
me to do? A thing I promise not to do is to develop and check on any
platform except mine.

> And wasn't it supposed to say
>
>       void **v = &client;
>
> instead?

The address of a local variable? I think it's correct as is.



  reply	other threads:[~2024-05-05  9:31 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  8:53 MPS image cache Gerd Möllmann
2024-05-03 10:58 ` Helmut Eller
2024-05-03 11:05   ` Po Lu
2024-05-03 11:22   ` Gerd Möllmann
2024-05-03 11:43     ` Gerd Möllmann
2024-05-03 13:24       ` Gerd Möllmann
2024-05-03 17:02         ` Gerd Möllmann
2024-05-04  4:38           ` MPS: scroll-bars (was: MPS image cache) Helmut Eller
2024-05-04  5:22             ` MPS: scroll-bars Gerd Möllmann
2024-05-04  5:29               ` Gerd Möllmann
2024-05-04  5:50             ` Po Lu
2024-05-04  6:27               ` Helmut Eller
2024-05-04  6:45                 ` Gerd Möllmann
2024-05-04  7:05                   ` Helmut Eller
2024-05-04  7:13                     ` Gerd Möllmann
2024-05-04  7:48                       ` Gerd Möllmann
2024-05-04  7:09                   ` Gerd Möllmann
2024-05-04  8:47                     ` Eli Zaretskii
2024-05-04  9:13                       ` Gerd Möllmann
2024-05-04  9:29                         ` Eli Zaretskii
2024-05-04 10:04                           ` Gerd Möllmann
2024-05-04 13:59                             ` MPS: w32 threads Eli Zaretskii
2024-05-04 14:20                               ` Gerd Möllmann
2024-05-05  8:27                                 ` Eli Zaretskii
2024-05-05  9:16                                   ` Gerd Möllmann
2024-05-05 14:39                                     ` Eli Zaretskii
2024-05-05 15:23                                       ` Gerd Möllmann
2024-05-05 15:26                                         ` Gerd Möllmann
2024-05-04  8:29                 ` MPS: scroll-bars Po Lu
2024-05-05  4:52                   ` Gerd Möllmann
2024-05-05  7:53                     ` Helmut Eller
2024-05-05  8:01                       ` Gerd Möllmann
2024-05-05  8:08                         ` Helmut Eller
2024-05-05 16:43                       ` Eli Zaretskii
2024-05-05 18:02                         ` Helmut Eller
2024-05-05 18:09                           ` Eli Zaretskii
2024-05-06 15:05                             ` Eli Zaretskii
2024-05-06 15:53                               ` Gerd Möllmann
2024-05-06 18:25                                 ` Eli Zaretskii
2024-05-07  6:07                                   ` Helmut Eller
2024-05-07 12:56                                     ` Eli Zaretskii
2024-05-07 16:27                                       ` Helmut Eller
2024-05-03 14:59     ` MPS image cache Helmut Eller
2024-05-03 15:11       ` Gerd Möllmann
2024-05-05  6:45         ` Gerd Möllmann
2024-05-05  7:02           ` Gerd Möllmann
2024-05-05  9:00             ` Eli Zaretskii
2024-05-05  9:31               ` Gerd Möllmann [this message]
2024-05-05 10:24                 ` Eli Zaretskii
2024-05-05 10:36                   ` Gerd Möllmann
2024-05-05 11:01                     ` Eli Zaretskii
2024-05-05 12:55                       ` Gerd Möllmann
2024-05-05 14:07                         ` Eli Zaretskii
2024-05-05 14:32                           ` Gerd Möllmann
2024-05-05 15:49                             ` Eli Zaretskii
2024-05-05 16:19                               ` Gerd Möllmann
2024-05-05 17:45                               ` Gerd Möllmann
2024-05-05 18:04                                 ` Eli Zaretskii
2024-05-05 18:13                                   ` Eli Zaretskii
2024-05-05 18:35                                     ` Gerd Möllmann
2024-05-05 19:18                                       ` Eli Zaretskii
2024-05-05 19:57                                         ` Gerd Möllmann
2024-05-05  8:16           ` Helmut Eller
2024-05-05  8:42             ` Gerd Möllmann
2024-05-06 14:16               ` Helmut Eller
2024-05-06 14:28                 ` Gerd Möllmann
2024-05-03 15:02     ` Helmut Eller
2024-05-04 17:51       ` Gerd Möllmann
2024-05-03 11:04 ` Eli Zaretskii
2024-05-03 11:08   ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2fruw8v10.fsf@pro2.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).