aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/Memory.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-05-03 13:50:56 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-05-03 13:50:56 +0000
commit95bda5e6ab6c2bdad322bd772dc7fb9e14ca7d78 (patch)
tree4fd1e6492007da0c938b5a7fa31d1b69eb088fd5 /Eigen/src/Core/util/Memory.h
parentfacee57b8d0f8343cb9b7d7db3ad5e454bc80915 (diff)
let the user disable alignment altogether by #defining EIGEN_DONT_ALIGN.
Until now, the user had to edit the source code to do that. Internally, add EIGEN_ALIGN that takes into account both EIGEN_DONT_ALIGN.and EIGEN_ARCH_WANTS_ALIGNMENT. From now on, only EIGEN_ALIGN should be used to test whether we want to align.
Diffstat (limited to 'Eigen/src/Core/util/Memory.h')
-rw-r--r--Eigen/src/Core/util/Memory.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index 934ccee4e..7309f69ed 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -74,11 +74,11 @@ inline void* ei_aligned_malloc(size_t size)
#endif
void *result;
- #if EIGEN_HAS_POSIX_MEMALIGN && EIGEN_ARCH_WANTS_ALIGNMENT && !EIGEN_MALLOC_ALREADY_ALIGNED
+ #if EIGEN_HAS_POSIX_MEMALIGN && EIGEN_ALIGN && !EIGEN_MALLOC_ALREADY_ALIGNED
if(posix_memalign(&result, 16, size))
result = 0;
#else
- #if !EIGEN_ARCH_WANTS_ALIGNMENT
+ #if !EIGEN_ALIGN
result = malloc(size);
#elif EIGEN_MALLOC_ALREADY_ALIGNED
result = malloc(size);
@@ -138,7 +138,7 @@ template<typename T, bool Align> inline T* ei_conditional_aligned_new(size_t siz
*/
inline void ei_aligned_free(void *ptr)
{
- #if !EIGEN_ARCH_WANTS_ALIGNMENT
+ #if !EIGEN_ALIGN
free(ptr);
#elif EIGEN_MALLOC_ALREADY_ALIGNED
free(ptr);
@@ -232,7 +232,7 @@ inline static int ei_alignmentOffset(const Scalar* ptr, int maxOffset)
ei_aligned_stack_free(PTR,sizeof(TYPE)*SIZE);} while(0)
-#if EIGEN_ARCH_WANTS_ALIGNMENT
+#if EIGEN_ALIGN
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) \
void *operator new(size_t size) throw() { \
return Eigen::ei_conditional_aligned_malloc<NeedsToAlign>(size); \