2011/10/4 Mike Hommey <m...@glandium.org>: > On Tue, Oct 04, 2011 at 10:20:16PM +0200, > > m0 is a 32-bit value, it needs 32-bits alignment. m1 is 16-bits, 16-bits > alignment, etc. Overall, the struct only requires 32-bits alignment.
Reading http://en.wikipedia.org/wiki/Data_structure_alignment, I thought that gcc was padding the internal data of a structure so that they are aligned. Furthermore, isn't nsID internal data nevertheless packed on 16 bytes after compilation (it is 4+2+2+8 = 16 bytes before compilation)? If "explicit" 64-bit alignment is still required, do we need to add dummy padding data to align nsID internal data? Such as (with alignment recommendations taken from http://software.intel.com/en-us/articles/data-alignment-when-migrating-to-64-bit-intel-architecture/): struct nsID { PRUint32 m0; PRUint16 m1; PRUint16 padding[1]; // 2 bytes for m2 to be aligned on a 4-byte boundary (*) PRUint16 m2; PRUint8 m3[8]; PRUint8 padding[6]; // 6 bytes to make total size of nsID 24 bytes }; Emeric -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org