|
From: | Paul Eggert |
Subject: | Re: Lisp_Marker size on 32bit systems |
Date: | Fri, 7 Sep 2018 00:15:57 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
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.
0001-Shrink-pseudovectors-a-bit.patch
Description: Text Data
marker24.diff
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |