Am Sonntag, 6. Mai 2007 12:32 schrieb pancake: [ no TOFU please ]
> I think that the right way to handle paddings for memory alignment > is using the pack(1) pragma directive to make everything fit on 1 > byte and ensure by code that what we do is correct (instead of > relaying this task to the compiler). This is usually not a good idea, as unaligned pointer or integer/long/double access is usually slower with many CPUs - if it even succeeds. > We can pack to 4 or so...some compilers (aka gcc) returns some > nasty sizes when measuring..(not necessary aligned to 4). You didn't get the problem probably. The mmx/sse copy operations need 8-byte [1] aligned start and end addresses for copying. If the addresses are not aligned, you'll get a bus error. Please note that this alignment is only needed for the memory pointer and for nothing else in that stucture. leo [1] there are 16-byte versions too and also some, which work with unaligned memory