Merge pull request #11 from Theodus/master

Fix assertion failure in memalign
This commit is contained in:
Matthew Parkinson
2019-01-30 17:36:13 +00:00
committed by GitHub

View File

@@ -140,7 +140,7 @@ extern "C"
for (; sc < NUM_SIZECLASSES; sc++)
{
size = sizeclass_to_size(sc);
if ((size & (~size - 1)) >= alignment)
if ((size & (~size + 1)) >= alignment)
{
return SNMALLOC_NAME_MANGLE(aligned_alloc)(alignment, size);
}