oops, got confused by the preprocessor directives around

posix_memalign...
This commit is contained in:
Gael Guennebaud 2009-02-21 16:35:57 +00:00
parent 7c4f9ecf0c
commit 3d86dcf473

View File

@ -75,9 +75,6 @@ inline void* ei_aligned_malloc(size_t size)
void *result;
#if EIGEN_HAS_POSIX_MEMALIGN && EIGEN_ARCH_WANTS_ALIGNMENT && !EIGEN_MALLOC_ALREADY_ALIGNED
#ifdef EIGEN_EXCEPTIONS
const int failed =
#endif
if(posix_memalign(&result, 16, size))
result = 0;
#else
@ -92,12 +89,9 @@ inline void* ei_aligned_malloc(size_t size)
#else
result = ei_handmade_aligned_malloc(size);
#endif
#ifdef EIGEN_EXCEPTIONS
const int failed = (result == 0);
#endif
#endif
#ifdef EIGEN_EXCEPTIONS
if(failed)
if(result == 0)
throw std::bad_alloc();
#endif
return result;