diff --git a/src/xenia/base/memory.h b/src/xenia/base/memory.h index 30b52ef77..05517a8e8 100644 --- a/src/xenia/base/memory.h +++ b/src/xenia/base/memory.h @@ -77,7 +77,11 @@ inline T* AlignedAlloc(size_t alignment) { #if XE_COMPILER_MSVC return reinterpret_cast(_aligned_malloc(sizeof(T), alignment)); #else - return reinterpret_cast(aligned_alloc(alignment, sizeof(T))); + void* ptr = nullptr; + if (posix_memalign(&ptr, alignment, sizeof(T))) { + return nullptr; + } + return reinterpret_cast(ptr); #endif // XE_COMPILER_MSVC }