Why travis doesn't have aligned_alloc but my other two unixes do, ?.
This commit is contained in:
parent
09aa3179fb
commit
1b487b67c9
|
@ -77,7 +77,11 @@ inline T* AlignedAlloc(size_t alignment) {
|
||||||
#if XE_COMPILER_MSVC
|
#if XE_COMPILER_MSVC
|
||||||
return reinterpret_cast<T*>(_aligned_malloc(sizeof(T), alignment));
|
return reinterpret_cast<T*>(_aligned_malloc(sizeof(T), alignment));
|
||||||
#else
|
#else
|
||||||
return reinterpret_cast<T*>(aligned_alloc(alignment, sizeof(T)));
|
void* ptr = nullptr;
|
||||||
|
if (posix_memalign(&ptr, alignment, sizeof(T))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
return reinterpret_cast<T*>(ptr);
|
||||||
#endif // XE_COMPILER_MSVC
|
#endif // XE_COMPILER_MSVC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue