On Wed, Feb 16, 2000 at 03:10:26AM -0800, Martin Buchholz wrote:
I had trouble understanding the alignment code, especially
align_table. Ideas:
Use ALIGNOF maybe?
#ifndef ALIGNOF
# if defined (__GNUC__) && (__GNUC__ >= 2)
# define ALIGNOF(x) __alignof__ (x)
# else
# define ALIGNOF(x) sizeof (x)
# endif
#endif
Nope, won't do. I don't want to align conses on a 12 bytes boundary
when 4 bytes is enough.
The maximum alignment required should be perhaps (from opaque.h)
typedef union
{
struct { Lisp_Object obj; } obj;
struct { void *p; } p;
struct { double d; } d;
} max_align_t;
We could move max_align_t to lisp.h, and have
size_t max_alignment = ALIGNOF (max_align_t);
Maybe. I know 256 as a max is overkill, but it doesn't cost us
anything, since we enumerate objects in reverse alignment order and
we're only using powers of two.
Yes, I know, that's perverted code, but it does a perverted thing.
OG.