Fix assertion failure in memalign

This commit is contained in:
theodus
2019-01-30 12:14:11 -05:00
parent a838372989
commit 61b310d9d6

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);
}