www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Alignments outside of structs

reply mclysenk mtu.edu writes:
I've been messing around with SSE in D.  One of the problems I've encountered is
forcing struct alignment to 16-byte boundaries in order to make use of movaps
and direct register-memory operations.  The problem with the align attribute is
that it only works on members within the struct.

In order to ensure alignment will I have to write a custom allocator, or am I
just using the attribute wrong?
Aug 12 2005
parent "Ben Hinkle" <ben.hinkle gmail.com> writes:
<mclysenk mtu.edu> wrote in message news:ddj523$1c5d$1 digitaldaemon.com...
 I've been messing around with SSE in D.  One of the problems I've 
 encountered is
 forcing struct alignment to 16-byte boundaries in order to make use of 
 movaps
 and direct register-memory operations.  The problem with the align 
 attribute is
 that it only works on members within the struct.

 In order to ensure alignment will I have to write a custom allocator, or 
 am I
 just using the attribute wrong?
I think the custom allocator is the way to go. To be honest I'm not sure you can write one for a struct but I suppose it's possible.
Aug 13 2005