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:
Michael Lotz
2009-10-22 13:06:15 +00:00
parent 4e61885e4a
commit ee7ec20503
2 changed files with 10 additions and 6 deletions
+5 -3
View File
@@ -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) {