Subj : Re: Performance impact of disaligned structures To : comp.programming From : Scott Moore Date : Tue Oct 04 2005 12:37 pm Gioele Barabucci wrote On 10/04/05 06:48,: > How much "worse" is this structure > > struct { > uint64 length; > uint32 id; > uint64 *next; /* this is 32 bits aligned */ > uint64 data[256]; /* this starts on the 32 bits boundary */ > } > > compared to this other > > struct { > uint64 length; > uint32 id; > uint32 padding; > uint64 *next; /* now this is 64 bits aligned */ > uint64 data[256]; /* and this starts on the 64 bits boundary */ > } > > on 32 bits and 64 bits architectures? > Probally no different, since the compiler likely padded the structure for proper alignment for you, unless you used flags to disable that. .