On Thu, Feb 17, 2000 at 05:14:24PM -0800, Martin Buchholz wrote:
If there are a variable number of obj's, and the size method
returns
offsetof (foo, obj[obj_count]), then we cannot portably pack foo's
using the size method.
True. OTOH, it's in the "it doesn't happen... yet" list.
If you want to save the space, then you must either do this
non-portably, or perhaps add alignment information to the
lrecord_description, or add an `align' method to struct lrecord_description.
A special XD_ALIGN tag? Hmmm, that's perverted. I like it. Except
that none of our structures would use it for now, which makes it far
less interesting...
But some, like Lips_Opaque, would use ALIGNOF (max_align_t)
OTOH we could use it for opaques. Good thinking Martin. I'll do it.
But strings data is either in a string_chars_block (it would be nice
to just copy all the string_chars_blocks into the dumped data,
preferably after compacting), or malloc()ed for big strings, in which
case the extra padding space will be insignificant.
I think it's nicer to have all the strings concatenated like we have
now (think docstrings, it'd love to have the DOC file in preloaded and
ending in the .dmp file) and going back to using string_char_blocks
only when we change the size of the string. I think that's the more
efficient way, both spacewise and sharing-wise.
I was wondering about that hardcoded 4. Use ALIGNOF (max_align_t)
instead?
Yup.
OG.