[sldev] [VWR] OpenJPEG backtraces

Callum Lerwick seg at haxxed.com
Tue Sep 25 19:49:34 PDT 2007


On Sun, 2007-09-23 at 15:02 +0200, Dale Glass wrote:
> Isn't malloc/new supposed to align already on the largest boundary needed 
> by the architecture? Meaning, if the largest alignment needed is 32 bits, 
> then everything returned by malloc should be 32 bits aligned.

Well there's a few issues here. One being, though 16 byte alignment may
not be strictly necessary, it can result in better performance due to...
lets just call it arcane details of the way CPU caches work. :) That's
probably why it was already trying to align the pointer.

The other issue being SSE. x86 only needed 8 byte alignment until SSE
came along, so for the most part most x86 libc's still only do 8 byte
alignment. SSE strictly requires 16 byte alignment.

This is all of course x86 centric, and I have no idea how much of this
applies to PPC and whatnot. Though I know Linux x86_64 always aligns to
16 bytes, (Well, mine does at least) and so does OSX (according to an
official TechNote) so you don't have to do anything special there. I
don't suppose someone could pull OpenJPEG from SVN and tell me if it
breaks on Solaris. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20070925/da010fdf/attachment.pgp


More information about the SLDev mailing list