From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: Lisp_Marker size on 32bit systems
Date: Fri, 07 Sep 2018 11:05:58 +0300 [thread overview]
Message-ID: <83bm99vijd.fsf@gnu.org> (raw)
In-Reply-To: <06d01a4b-9d98-df5b-be8a-aeda449acad7@cs.ucla.edu> (message from Paul Eggert on Fri, 7 Sep 2018 00:15:57 -0700)
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Fri, 7 Sep 2018 00:15:57 -0700
> Cc: emacs-devel@gnu.org
>
> 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
next prev parent reply other threads:[~2018-09-07 8:05 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-06 0:41 Lisp_Marker size on 32bit systems Stefan Monnier
2018-09-06 6:51 ` Paul Eggert
2018-09-06 12:17 ` Stefan Monnier
2018-09-07 7:15 ` Paul Eggert
2018-09-07 8:05 ` Eli Zaretskii [this message]
2018-09-07 13:45 ` Paul Eggert
2018-09-07 14:12 ` GDB and compiler-operations (was: Lisp_Marker size on 32bit systems) Stefan Monnier
2018-09-07 14:23 ` Eli Zaretskii
2018-09-07 15:16 ` GDB and compiler-operations Andreas Schwab
2018-09-07 15:48 ` GDB and compiler-operations (was: Lisp_Marker size on 32bit systems) Paul Eggert
2018-09-07 15:58 ` GDB and compiler-operations Stefan Monnier
2018-09-07 17:11 ` Eli Zaretskii
2018-09-07 17:15 ` Paul Eggert
2018-09-07 19:59 ` Tom Tromey
2018-09-07 14:19 ` Lisp_Marker size on 32bit systems Eli Zaretskii
2018-09-07 16:27 ` Paul Eggert
2018-09-07 17:16 ` Eli Zaretskii
2018-09-07 18:13 ` Paul Eggert
2018-09-07 18:32 ` Eli Zaretskii
2018-09-07 19:05 ` Paul Eggert
2018-09-07 19:22 ` Eli Zaretskii
2018-09-07 12:16 ` Stefan Monnier
2018-09-07 19:04 ` Paul Eggert
2018-09-07 19:45 ` Stefan Monnier
2018-09-07 21:03 ` Paul Eggert
2018-09-08 1:54 ` Stefan Monnier
2018-09-08 3:04 ` Paul Eggert
2018-09-08 3:10 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83bm99vijd.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.