mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +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
|
||||
if(ei_packet_traits<T>::size>1)
|
||||
{
|
||||
void* ptr;
|
||||
#ifdef _MSC_VER
|
||||
if(ptr = _aligned_malloc(size*sizeof(T), 16))
|
||||
return static_cast<T*>(_aligned_malloc(size*sizeof(T), 16));
|
||||
#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
|
||||
return static_cast<T*>(ptr);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user