3 ms·
The linked table claims that integers and smallints always require an alignment of one word, which is untrue, as you also point out. There is no sense in which
by ghusbands 4y ago
The linked table claims that integers and smallints always require an alignment of one word, which is untrue, as you also point out. There is no sense in which a two-byte smallint 'requires' an alignment of four or eight bytes, as listed.
Instead, the "alignment needed" column is a self-fulfilling prophecy that tells you the required alignment for the succeeding column if the succeeding column is of at least a size requiring that alignment, and then it's not a required alignment for that type but instead that for a different type.