On Monday, 28 October 2013 at 02:44:54 UTC, Manu wrote:But is that really what it means though? From the above conversation, it would instead appear to mean that:
I had a lot of informal conversations with Walter trying to get my head
around the details here.
To my recollection, the intent was that it should behave like C, and that
S.alignof must certainly == 128 in that case. It can't work otherwise.
Alignment must be inherited by parent structures.
struct S
{
int i;
align(128) int j;
}
in this case, the *padding* needed until we reach j is 128 bytes.
It doesn't mean that S itself need to be 128 aligned.
Does it make sense (and should it be illegal) in that case to have anything with alignment > 8 ? I just don't see how something like "malloc" would be able to deal with them otherwise... ?I also recall commenting on that case with ulong. On most architectures it
only needs to be 4 byte aligned, but that one is arch specific.