Account for single page allocations. They aren't used anywhere right now because
the bin sizes ensure that when hitting this case it always allocates multiple pages. This makes it more flexible for other use cases though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33726 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4e61885e4a
commit
ee7ec20503
@ -1296,13 +1296,15 @@ heap_allocate_contiguous_pages(heap_allocator *heap, uint32 pageCount)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (first > 0) {
|
||||
if (first < 0)
|
||||
first = i;
|
||||
|
||||
if (first >= 0) {
|
||||
if ((i + 1 - first) == pageCount) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
first = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
|
@ -925,13 +925,15 @@ heap_allocate_contiguous_pages(heap_allocator *heap, uint32 pageCount)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (first > 0) {
|
||||
if (first < 0)
|
||||
first = i;
|
||||
|
||||
if (first >= 0) {
|
||||
if ((i + 1 - first) == pageCount) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
first = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
|
Loading…
Reference in New Issue
Block a user