July 22, 2009
10:26 p.m.
What do you propose for doing proper alignment, then?
May be "void* dummy[4]" is better for force alignment ?
That would have the same alignment as a single pointer.
What about alignment on platforms with pointers > 32 bit ?
The C compiler will choose the alignment of the union to be the alignment of the union branch that requires that largest alignment. So if the largest alignment is the one that a pointer has, then alignof(PyGC_HEAD) == alignof(gc_next). The double is in the union only in case it has larger alignment than a pointer. Regards, Martin