[nycbug-talk] 1U Server Recommendations

alex at pilosoft.com alex
Wed Jan 12 00:38:38 EST 2005


On Wed, 12 Jan 2005 alex at pilosoft.com wrote:

> In addition, if you have structs with members that are less than 64-bit, 
> they will be aligned on 64-bit boundaries. If you have struct {char 
> a,b,c;}, it'll take 3*32-bit space on ia32, and 3*64bit space on x86_64.
Mutter, it's too late in the night to do thinking, I'm wrong on this one.  
Struct members are naturally-aligned (i.e. alignment is to the data type's
own size, chars are not aligned at all, etc) - thus {char a,b,c;} will
take 3*8 bit of space on any architecture.

However, {char a;int *b;} will be 4+4 bytes on 32-bit and 8+8 bytes on
64-bit still. 





More information about the talk mailing list