From 60fb713d1995a0055e203def9c4436393e6557e1 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sun, 7 Feb 2010 16:55:43 +0000 Subject: [PATCH] Must only advance by step sizes, otherwise we may end up with misaligned pages again. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35426 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/heap.cpp | 2 +- src/system/libroot/posix/malloc_debug/heap.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/heap.cpp b/src/system/kernel/heap.cpp index b40136ca68..bcba96cf91 100644 --- a/src/system/kernel/heap.cpp +++ b/src/system/kernel/heap.cpp @@ -1339,7 +1339,7 @@ heap_allocate_contiguous_pages(heap_allocator *heap, uint32 pageCount, for (uint32 j = 1; j < pageCount; j++) { if (area->page_table[i + j].in_use) { first = -1; - i += j; + i += j / step * step; break; } } diff --git a/src/system/libroot/posix/malloc_debug/heap.cpp b/src/system/libroot/posix/malloc_debug/heap.cpp index 3f6a4f8c31..943f28bc0a 100644 --- a/src/system/libroot/posix/malloc_debug/heap.cpp +++ b/src/system/libroot/posix/malloc_debug/heap.cpp @@ -947,7 +947,7 @@ heap_allocate_contiguous_pages(heap_allocator *heap, uint32 pageCount, for (uint32 j = 1; j < pageCount; j++) { if (area->page_table[i + j].in_use) { first = -1; - i += j; + i += j / step * step; break; } }