mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 01:29:35 +08:00
Added MSVC stack allocation support.
This commit is contained in:
parent
0326a51f89
commit
cc33a56140
@ -429,6 +429,11 @@ inline static Integer ei_first_aligned(const Scalar* array, Integer size)
|
|||||||
? alloca(SIZE) \
|
? alloca(SIZE) \
|
||||||
: ei_aligned_malloc(SIZE)
|
: ei_aligned_malloc(SIZE)
|
||||||
#define ei_aligned_stack_free(PTR,SIZE) if(SIZE>EIGEN_STACK_ALLOCATION_LIMIT) ei_aligned_free(PTR)
|
#define ei_aligned_stack_free(PTR,SIZE) if(SIZE>EIGEN_STACK_ALLOCATION_LIMIT) ei_aligned_free(PTR)
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define ei_aligned_stack_alloc(SIZE) (SIZE<=EIGEN_STACK_ALLOCATION_LIMIT) \
|
||||||
|
? _alloca(SIZE) \
|
||||||
|
: ei_aligned_malloc(SIZE)
|
||||||
|
#define ei_aligned_stack_free(PTR,SIZE) if(SIZE>EIGEN_STACK_ALLOCATION_LIMIT) ei_aligned_free(PTR)
|
||||||
#else
|
#else
|
||||||
#define ei_aligned_stack_alloc(SIZE) ei_aligned_malloc(SIZE)
|
#define ei_aligned_stack_alloc(SIZE) ei_aligned_malloc(SIZE)
|
||||||
#define ei_aligned_stack_free(PTR,SIZE) ei_aligned_free(PTR)
|
#define ei_aligned_stack_free(PTR,SIZE) ei_aligned_free(PTR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user