EIGEN_NO_MALLOC must also block traditional unaligned malloc

This commit is contained in:
Benoit Jacob 2009-01-10 14:24:55 +00:00
parent 50ad8b9010
commit 4361cb8913

View File

@ -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();