The alignof measures type alignment as a complete object; those. when it is allocated as a separate object or element of an array. This is not necessarily the same as alignment requirements of this type as a subobject; Are the members of the POD structure type or standard layout type consistent according to their alignment requirements?
The alignment of a 64-bit integer within the structure is specified using the x386 ABI of 4 bytes; gcc does not have the right to modify this, as this will violate binary compatibility with other object files and programs. However, it can align 64-bit integer objects with 8 bytes, as this does not affect the ABI and provides more efficient memory access.
ecatmur
source share