Fix subtle logic error that would always cause a needless large allocation if an alignment was given.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26215 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-07-02 09:50:58 +00:00
parent b7cb8f8c30
commit 7431b5241e
+1 -1
View File
@@ -975,7 +975,7 @@ heap_memalign(heap_allocator *heap, size_t alignment, size_t size,
// aligned) page has to be allocated anyway.
size_t elementSize = heap->bins[binIndex].element_size;
if (size <= elementSize && (alignment == 0
|| (elementSize & (alignment - 1) == 0)))
|| (elementSize & (alignment - 1)) == 0))
break;
}