mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-26 16:34:35 +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>
|
#include <cstdlib>
|
||||||
void *aligned_alloc(size_t alignment, size_t size)
|
void *aligned_alloc(size_t alignment, size_t size)
|
||||||
{
|
{
|
||||||
|
// alignment must be >= sizeof(void*)
|
||||||
|
if(alignment < sizeof(void*))
|
||||||
|
{
|
||||||
|
alignment = sizeof(void*);
|
||||||
|
}
|
||||||
|
|
||||||
void *pointer;
|
void *pointer;
|
||||||
posix_memalign(&pointer, alignment, size);
|
if(posix_memalign(&pointer, alignment, size) == 0)
|
||||||
return pointer;
|
return pointer;
|
||||||
|
return VMA_NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user