We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94fa0a8 commit f443054Copy full SHA for f443054
src/vk_mem_alloc.h
@@ -1747,9 +1747,16 @@ remove them if not needed.
1747
#include <cstdlib>
1748
void *aligned_alloc(size_t alignment, size_t size)
1749
{
1750
+ // alignment must be >= sizeof(void*)
1751
+ if(alignment < sizeof(void*))
1752
+ {
1753
+ alignment = sizeof(void*);
1754
+ }
1755
+
1756
void *pointer;
- posix_memalign(&pointer, alignment, size);
- return pointer;
1757
+ if(posix_memalign(&pointer, alignment, size) == 0)
1758
+ return pointer;
1759
+ return VMA_NULL;
1760
}
1761
#endif
1762
0 commit comments