- alignment is the reason why we can Hide data in pointer
- In general, a struct instance will have the alignment of its widest scalar member.
- In C, there is no leading padding, but do has trailing padding
sizeof(char *) = 8
sizeof(long) = 8
sizeof(int) = 4
sizeof(short) = 2
sizeof(char) = 1
sizeof(float) = 4
sizeof(double) = 8
sizeof(struct foo1) = 24
sizeof(struct foo2) = 24
sizeof(struct foo3) = 16
sizeof(struct foo4) = 4
sizeof(struct foo5) = 24
sizeof(struct foo6) = 8
sizeof(struct foo7) = 4
sizeof(struct foo8) = 8
sizeof(struct foo9) = 12
sizeof(struct foo10) = 24
sizeof(struct foo11) = 16
sizeof(struct foo12) = 24
This looks like a 64-bit machine.
Self-alignment seems to be required.
Reference