Structure Member Padding

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Jul 13 07:00:24 AEST 1990


In article <17069 at haddock.ima.isc.com> karl at kelp.ima.isc.com (Karl Heuer) writes:
>I don't get it.  Why should a half-word of internal padding be necessary or
>desirable?  Looks to me like the obvious implementation is to make it a
>two-word struct, with the first word containing s and a and b, and the second
>word containing c and three pad bytes.  What's the problem?

On many, perhaps most, word-addressed architectures there are speed advantages
to not trying to pack different small data types within the same word, unless
bit fields are explicitly requested.



More information about the Comp.std.c mailing list