mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Reversed alignedMalloc return value.
posix_memalign returns false on success; using == 0 instead of != 0 reverses it, allowing alignedMalloc to return true on success and false otherwise (mimicking what happens under Windows). --HG-- branch : Nixola/reversed-alignedmalloc-return-value-posi-1512135128149
This commit is contained in:
@@ -38,7 +38,7 @@ bool alignedMalloc(void **mem, size_t size, size_t alignment)
|
||||
*mem = _aligned_malloc(size, alignment);
|
||||
return *mem != nullptr;
|
||||
#else
|
||||
return posix_memalign(mem, alignment, size) != 0;
|
||||
return posix_memalign(mem, alignment, size) == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user