mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-23 01:59:38 +08:00
oops, got confused by the preprocessor directives around
posix_memalign...
This commit is contained in:
parent
7c4f9ecf0c
commit
3d86dcf473
@ -75,9 +75,6 @@ inline void* ei_aligned_malloc(size_t size)
|
|||||||
|
|
||||||
void *result;
|
void *result;
|
||||||
#if EIGEN_HAS_POSIX_MEMALIGN && EIGEN_ARCH_WANTS_ALIGNMENT && !EIGEN_MALLOC_ALREADY_ALIGNED
|
#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))
|
if(posix_memalign(&result, 16, size))
|
||||||
result = 0;
|
result = 0;
|
||||||
#else
|
#else
|
||||||
@ -92,12 +89,9 @@ inline void* ei_aligned_malloc(size_t size)
|
|||||||
#else
|
#else
|
||||||
result = ei_handmade_aligned_malloc(size);
|
result = ei_handmade_aligned_malloc(size);
|
||||||
#endif
|
#endif
|
||||||
#ifdef EIGEN_EXCEPTIONS
|
|
||||||
const int failed = (result == 0);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef EIGEN_EXCEPTIONS
|
#ifdef EIGEN_EXCEPTIONS
|
||||||
if(failed)
|
if(result == 0)
|
||||||
throw std::bad_alloc();
|
throw std::bad_alloc();
|
||||||
#endif
|
#endif
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user