>>>> "OG" == Olivier Galibert
<galibert(a)pobox.com> writes:
OG> That would be nice and cool, except that there is one exception. Some
OG> lrecords are lying a little. Well, to be more precise, they give
OG> sizes that are not the result of a sizeof, and don't necessarily
OG> respect (2). In particular, the opaques do that. If that case, the
OG> minimal alignment is sizeof(lrecord_header) (i.e. 4, but it should
OG> have been written as a sizeof).
Design Proposal - I propose that:
We require the lcrecords _not_ to lie, but instead require the
size_in_bytes method to have the same alignment constraints as ANSI C
imposes.
So, for example, when a Lisp_Opaque is allocated, it (actually
make_opaque()) aligns its size to ALIGNOF (lcrecord_header) before
calling alloc_lcrecord.
And the size_in_bytes method will return the same size.
(Note that OPAQUE_SIZE still returns the old unaligned size, so
clients of opaque.c don't have to change.)
The ALIGN_SIZE and ALIGN_PTR methods should go into lisp.h with the
definition of ALIGNOF.
Then we can remove the special handling for lrecords in dumper.c, and
remove the is_lrecord member from struct pdump_entry_list_elmt, since
it is only used to kludge around the incorrect sizes.