[Python-Dev] mingw32 and gc-header weirdness
"Martin v. Löwis"
martin at v.loewis.de
Thu Jul 23 05:26:20 CEST 2009
>> 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
More information about the Python-Dev
mailing list