mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 12:20:07 +00:00
Fixed aligned_alloc for Android API < 16. Issue #49. Thanks @zhaijialong !
This commit is contained in:
parent
7a6e442b66
commit
1146b45c63
@ -2798,7 +2798,19 @@ remove them if not needed.
|
||||
#define VMA_NULL nullptr
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(__ANDROID__)
|
||||
#if defined(__ANDROID_API__) && (__ANDROID_API__ < 16)
|
||||
#include <cstdlib>
|
||||
void *aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
// alignment must be >= sizeof(void*)
|
||||
if(alignment < sizeof(void*))
|
||||
{
|
||||
alignment = sizeof(void*);
|
||||
}
|
||||
|
||||
return memalign(alignment, size);
|
||||
}
|
||||
#elif defined(__APPLE__) || defined(__ANDROID__)
|
||||
#include <cstdlib>
|
||||
void *aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user