mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-25 07:43:14 +08:00
small optimization (for MSVC) and simplification of ei_alligned_malloc
This commit is contained in:
parent
dd139b92b4
commit
9b1a3d6e19
@ -57,15 +57,15 @@ inline T* ei_aligned_malloc(size_t size)
|
|||||||
#ifdef EIGEN_VECTORIZE
|
#ifdef EIGEN_VECTORIZE
|
||||||
if(ei_packet_traits<T>::size>1)
|
if(ei_packet_traits<T>::size>1)
|
||||||
{
|
{
|
||||||
void* ptr;
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
if(ptr = _aligned_malloc(size*sizeof(T), 16))
|
return static_cast<T*>(_aligned_malloc(size*sizeof(T), 16));
|
||||||
#else
|
#else
|
||||||
if(posix_memalign(&ptr, 16, size*sizeof(T))==0)
|
void* ptr;
|
||||||
|
if(posix_memalign(&ptr, 16, size*sizeof(T))==0)
|
||||||
|
return static_cast<T*>(ptr);
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
return static_cast<T*>(ptr);
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user