* Fix some coding style issues
* Stumbled upon a possible bug while trying to understand the reuse of large allocations. The "first" variable was always set to the current index at the end of the loop, even if it was already set. This should have caused that the success condition to never be reached. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23866 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -477,12 +477,11 @@ memalign(size_t alignment, size_t size)
|
|||||||
if (first > 0) {
|
if (first > 0) {
|
||||||
if ((1 + i - first) * B_PAGE_SIZE > size)
|
if ((1 + i - first) * B_PAGE_SIZE > size)
|
||||||
break;
|
break;
|
||||||
}
|
} else
|
||||||
first = i;
|
first = i;
|
||||||
}
|
}
|
||||||
if (first > -1)
|
if (first > -1)
|
||||||
address = (void *)(heap_base + first * B_PAGE_SIZE);
|
address = (void *)(heap_base + first * B_PAGE_SIZE);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (address == NULL)
|
if (address == NULL)
|
||||||
address = raw_alloc(size, bin_index);
|
address = raw_alloc(size, bin_index);
|
||||||
|
|||||||
Reference in New Issue
Block a user