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.
This commit is contained in:
Michael Lotz 2011-11-13 21:24:24 +01:00
parent a28bab4790
commit 5247333d36

View File

@ -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);