As a general rule of thumb, if you sort your structs into decreasing size, it usually comes out right. That is, put all your 64-bit items first, then all your 32-bit items, then 16-bit, then 8-bit. Then there are no "holes" except the one at the end, which most compilers are pretty good at keeping track of. But yes, you could still certainly misalign the whole struct if it's embedded in a stream of something with smaller alignment constraints. Larry
- Just in case you were wondering if alignment matters... Dan Sugalski
- Re: Just in case you were wondering if alignment matte... Kai Henningsen
- Re: Just in case you were wondering if alignment matte... Uri Guttman
- Re: Just in case you were wondering if alignment m... Dan Sugalski
- Re: Just in case you were wondering if alignme... Nicholas Clark
- Re: Just in case you were wondering if ali... Uri Guttman
- Re: Just in case you were wondering i... Alan Burlison
- Re: Just in case you were wonderi... Dan Sugalski
- Larry Wall