From 5e5eef0b5bf3d6e88a3c5d1cde24d254209a88b6 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Wed, 7 Dec 2011 00:07:21 +0100 Subject: [PATCH] Fix the page need calculation, it was possibly off by one. --- src/system/kernel/guarded_heap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/kernel/guarded_heap.cpp b/src/system/kernel/guarded_heap.cpp index 44db207b28..dba0c3ae57 100644 --- a/src/system/kernel/guarded_heap.cpp +++ b/src/system/kernel/guarded_heap.cpp @@ -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;