From 5247333d36970134729fdbf67e2120b56d0308dc Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sun, 13 Nov 2011 21:24:24 +0100 Subject: [PATCH] Don't do the heap size calculation when using the slab as heap. The initial heap size calculation only applies to the legacy/debug heap, so it isn't needed when using the slab as kernel heap. --- src/system/kernel/vm/vm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 9d22d21634..65d195e825 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -3664,6 +3664,9 @@ vm_init(kernel_args* args) vm_page_init_num_pages(args); sAvailableMemory = vm_page_num_pages() * B_PAGE_SIZE; + slab_init(args); + +#if !USE_SLAB_ALLOCATOR_FOR_MALLOC size_t heapSize = INITIAL_HEAP_SIZE; // try to accomodate low memory systems while (heapSize > sAvailableMemory / 8) @@ -3671,9 +3674,6 @@ vm_init(kernel_args* args) if (heapSize < 1024 * 1024) panic("vm_init: go buy some RAM please."); - slab_init(args); - -#if !USE_SLAB_ALLOCATOR_FOR_MALLOC // map in the new heap and initialize it addr_t heapBase = vm_allocate_early(args, heapSize, heapSize, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0);