[AD] aligned_malloc()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I have started looking at replacing rectfill() with some MMX/SSE

I recently posted some results on a.cc http://www.allegro.cc/forums/thread/560888#target (i also have some impressive blit() SSE2 results too, but until further testing confirms results...)


hopefully the numbers will help the nay sayers to finally agree with me about replacing all the malloc() with aligned_malloc()

thank you to whoever sorted out the   malloc()  with  _al_malloc()
can we now modify those wrappers to add a #define that allows them to be aligned_malloc() ?

here are a few more notes on GCC's  aligned_malloc() solution:


-------- snipped from a mail list somewhere-------
mm_malloc.h is included in the mingw distro of gcc-3.4.4 (as a backport
from trunk).
>
>// Override operator new with aligned version:
>// (This requires gcc with mm_malloc support. Otherwise use the aligned_malloc in mingw's malloc.h)
>#include <mm_malloc.h>
>inline void* operator new (std::size_t sz)
>{
>  // fixme: throw bad_alloc on error
>  void *p = (void *) _mm_malloc (sz, 16);
>  return p;
>}

Oops I forgot to add that you also need to override operator delete
(with a wrapper for _mm_free) as well
------------------------------------------------------------------------------




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/