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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user