diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-01-10 14:24:55 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-01-10 14:24:55 +0000 |
commit | 4361cb8913107de67585fcfe0f57e2ea5daf6ae0 (patch) | |
tree | 33721d21084f6bdf38ae03de44b4cb26c7d94fa7 /Eigen | |
parent | 50ad8b901053c08519663c0f0310fe9c70365e9f (diff) |
EIGEN_NO_MALLOC must also block traditional unaligned malloc
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 37763c44d..bfe342da1 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -109,6 +109,10 @@ template<bool Align> inline void* ei_conditional_aligned_malloc(size_t size) template<> inline void* ei_conditional_aligned_malloc<false>(size_t size) { + #ifdef EIGEN_NO_MALLOC + ei_assert(false && "heap allocation is forbidden (EIGEN_NO_MALLOC is defined)"); + #endif + void *void_result = malloc(size); #ifdef EIGEN_EXCEPTIONS if(!void_result) throw std::bad_alloc(); |