mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 04:10:06 +00:00
Fix for aligned_alloc for Apple MolenVK. Thanks @rextimmy !
This commit is contained in:
parent
94fa0a8e4d
commit
f44305429c
@ -1747,9 +1747,16 @@ remove them if not needed.
|
||||
#include <cstdlib>
|
||||
void *aligned_alloc(size_t alignment, size_t size)
|
||||
{
|
||||
// alignment must be >= sizeof(void*)
|
||||
if(alignment < sizeof(void*))
|
||||
{
|
||||
alignment = sizeof(void*);
|
||||
}
|
||||
|
||||
void *pointer;
|
||||
posix_memalign(&pointer, alignment, size);
|
||||
return pointer;
|
||||
if(posix_memalign(&pointer, alignment, size) == 0)
|
||||
return pointer;
|
||||
return VMA_NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user