emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp_Marker size on 32bit systems


From: Eli Zaretskii
Subject: Re: Lisp_Marker size on 32bit systems
Date: Fri, 07 Sep 2018 11:05:58 +0300

> From: Paul Eggert <address@hidden>
> Date: Fri, 7 Sep 2018 00:15:57 -0700
> Cc: address@hidden
> 
> Stefan Monnier wrote:
> 
> > Thanks.  AFAICT the only solution is to use the GCALIGNED_UNION trick in
> > each and every "real Lisp_Object struct" rather than once and forall in
> > vectorlike_header.
> 
> The trick does need to move out of union vectorlike_header. However, the 
> trick 
> is not needed for most of those structs, since they're allocated only by the 
> GC 
> and are therefore already GC-aligned. The trick is needed only for structs 
> that 
> C might allocate statically or on the stack, and whose addresses are tagged 
> as 
> Lisp pointers. Just a few types do that, and I've noted them in the first 
> attached patch.
> 
> Although the first attached patch shrinks sizeof (struct Lisp_Maker) from 32 
> to 
> 24 bytes on x86 as requested, allocate_pseudovector still *allocates* 32 
> bytes 
> for the struct, as it rounds the size up to the next multiple of alignof 
> (max_align_t), which is 16 on x86. It's not hard to change that to 8 (please 
> see 
> 2nd attached patch) but this causes a 20% CPU performance hit (!) to 'make 
> compile-always' on my platform (AMD Phenom II X4 910e circa 2010, Fedora 28 
> x86-64, gcc -m32 -march=native), so I didn't install and can't recommend the 
> 2nd 
> attached patch.

The current master fails to build in the x86 32-bit configuration with
wide ints:

  In file included from lisp.h:35:0,
                   from window.c:25:
  ../lib/verify.h:207:21: error: static assertion failed: "verify (header_size 
== sizeof (union vectorlike_header))"
   # define _GL_VERIFY _Static_assert
                       ^
  ../lib/verify.h:252:20: note: in expansion of macro '_GL_VERIFY'
   # define verify(R) _GL_VERIFY (R, "verify (" #R ")")
                      ^~~~~~~~~~
  lisp.h:1630:1: note: in expansion of macro 'verify'
   verify (header_size == sizeof (union vectorlike_header));
   ^~~~~~
  Makefile:385: recipe for target `window.o' failed



reply via email to

[Prev in Thread] Current Thread [Next in Thread]