struct Test
{
int a;
char b;
int c;
} __attribute__((packed, aligned( 128 )))test;
sizeof( test ) returns 128 .
Why is the size not 9 ?
Is it that memory is rounded of to multiple of 128 ?
For example:
struct Test
{
int b;
char c;
} test;
sizeof( test ) returns 8 ( rounded of to multiple of 8 )
If you were to create an array of
struct Testthen each element would need to be 128 byte aligned, therefore each instance of the struct needs to be padded to a multiple of 128 bytes to maintain this. Hencesizeof(struct Test)= 128.