mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-10 10:41:52 +00:00
Only use system aligned_alloc on mac/ios if the SDK has them.
Bug: chromium:1098741 Change-Id: I4df73f581c2a6895c7f136ff974db0371c48cc5e
This commit is contained in:
parent
5ef3d923d5
commit
c331971b30
@ -3955,11 +3955,18 @@ void *vma_aligned_alloc(size_t alignment, size_t size)
|
||||
}
|
||||
#elif defined(__APPLE__) || defined(__ANDROID__) || (defined(__linux__) && defined(__GLIBCXX__) && !defined(_GLIBCXX_HAVE_ALIGNED_ALLOC))
|
||||
#include <cstdlib>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <AvailabilityMacros.h>
|
||||
#endif
|
||||
|
||||
void *vma_aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__APPLE__) && (defined(MAC_OS_X_VERSION_10_15) || defined(__IPHONE_13_0))
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
||||
if (__builtin_available(macOS 10.15, iOS 13, *))
|
||||
return aligned_alloc(alignment, size);
|
||||
#endif
|
||||
#endif
|
||||
// alignment must be >= sizeof(void*)
|
||||
if(alignment < sizeof(void*))
|
||||
|
Loading…
Reference in New Issue
Block a user