From 2b020b220b1e274bb16bbbde07dd08048de6d43c Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Fri, 21 Aug 2020 15:09:47 +0100 Subject: [PATCH] Less constrictive alignment test switch to malloc --- src/TaskScheduler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/TaskScheduler.cpp b/src/TaskScheduler.cpp index 5f91cbb2..88555141 100644 --- a/src/TaskScheduler.cpp +++ b/src/TaskScheduler.cpp @@ -167,8 +167,7 @@ ENKITS_API void* enki::DefaultAllocFunc( size_t align_, size_t size_, void* user pRet = (void*)_aligned_malloc( size_, align_ ); #else pRet = nullptr; - if( ( size_ == sizeof(uint32_t) && align_ == alignof(uint32_t) ) - || ( size_ == sizeof(intptr_t) && align_ == alignof(intptr_t) ) ) + if( align_ <= size_ && align_ <= alignof(int64_t) ) { // no need for alignment, use malloc pRet = malloc( size_ );