Hacker News new | ask | show | jobs
by bobmcnamara 326 days ago
Not the sizes, the alignments.
1 comments

Same thing in C though, the primitive types have the same alignment as their size.
That is true on some systems, but not a portable assumption by any means.

Edit:

st7: sizeof(uint32_t)=4, aligned(uint32_t)=1

msp430: sizeof(int)=2, alignof(int)= 1

Real old ARM: sizeof(double)=8, alignof(double)=4

OG M68k sizeof(char)=1, but struct align(char)=2