
sizeof/alignof - struct
struct A {
int x; // alignment: 4, size: 4, offset: 0
char y; // alignment: 1, size: 1, offset: 4 (= sizeof(x))
};
A a; // alignment: 4, size: 8 -> next_multiple(sizeof(x) + sizeof(y), alignof(x))
struct B {
char x; // alignment: 1, size: 1, offset: 0
int y; // alignment: 4, size: 4, offset: 4 -> next_multiple(sizeof(x), alignof(y))
};
B b; // alignment: 4, size: 8 (same of A)
struct C {
short x; // alignment: 2, size: 2, offset: 0
int y; // alignment: 4, size: 4, offset: 4 -> next_multiple(sizeof(x), alignof(y))
char z; // alignment: 1, size: 1, offset: 8
};
C c; // alignment: 4, size: 12 -> next_multiple(sizeof({x,y}) + sizeof(z), alignof(y))
102/104