[eigen] platform detection for aligned malloc

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


I'm reworking the platform detection for aligned malloc.
One recent change is that we now need aligned malloc even if
vectorization is not used. So if we want to use _mm_malloc we need to
use it from another header than emmintrin.h. I heard there's a
mm_malloc.h on some platforms but i'm not too sure.

Another finding i made is that on freebsd too, malloc() is 16 byte aligned.

Please find attached a patch, it's the best i can do but it needs improvements.
 --> question: in current SVN we always add manually the prototype of
posix_memalign. with this patch, we do it only if not declared by
<cstdlib> that is if _XOPEN_SOURCE<600. Anyway, is this really good
practice? If XOPEN_SOURCE<600 then maybe we really can't use
posix_memalign, i mean, there's got to be a reason why it's not
---> need to check especially with GCC 3...
*Mac OSX and FreeBSD:
---> Problem solved, we use malloc()
*Other BSDs:
---> no clue
----> no clue
----> problem solved, we use _aligned_malloc
---> we use _mm_malloc. Question: do we need to #include some header,
like <mm_malloc.h>? When vectorization is not enabled we can't count
on emmintrin.h.
---> Gael formerly made it use _mm_malloc, so same question as ICC,
which header to include?
Old GCC:



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