Fix the page need calculation, it was possibly off by one.

This commit is contained in:
Michael Lotz 2011-12-07 00:07:21 +01:00
parent 02e8a1d136
commit 5e5eef0b5b

View File

@ -333,7 +333,8 @@ guarded_heap_area_init(guarded_heap& heap, area_id id, void* baseAddress,
area->used_pages = 0;
size_t pagesNeeded = (sizeof(guarded_heap_area)
+ area->page_count * sizeof(guarded_heap_page)) / B_PAGE_SIZE;
+ area->page_count * sizeof(guarded_heap_page)
+ B_PAGE_SIZE - 1) / B_PAGE_SIZE;
area->page_count -= pagesNeeded;
area->size = area->page_count * B_PAGE_SIZE;