need clarification of operator new and __m128

Matthias Kretz
Fri Aug 14 13:01:00 GMT 2009


On Friday 14 August 2009 12:59:30 Matthias Kretz wrote:
> Is this a bug in my code or in gcc? Do I have to add the alignment
> restriction to the Vector class itself also?

Thinking about this further I think this is not gcc's responsibility since 
operator new (or malloc) are library functions and those know nothing of the 
alignment restrictions of the underlying type, right?

So the correct thing to do is to overload operator new/new[]/delete/delete[] 
in my classes an let them return
_mm_malloc(size, 16);
and respectively call
. Did I get this right, now?


More information about the Gcc-help mailing list