mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-10 18:59:01 +08:00
EIGEN_NO_MALLOC must also block traditional unaligned malloc
This commit is contained in:
parent
50ad8b9010
commit
4361cb8913
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user