From 9111376d70a89440a8a37a6e45d1191459487b6c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 28 Dec 2021 19:19:52 +0100 Subject: [PATCH] Kernel: Rename kmalloc_pool_heap => initial_kmalloc_memory --- Kernel/Heap/kmalloc.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp index 68443886fde..a26923b4c1a 100644 --- a/Kernel/Heap/kmalloc.cpp +++ b/Kernel/Heap/kmalloc.cpp @@ -28,7 +28,10 @@ static constexpr size_t CHUNK_SIZE = 32; static constexpr size_t CHUNK_SIZE = 64; #endif -#define POOL_SIZE (2 * MiB) +static constexpr size_t INITIAL_KMALLOC_MEMORY_SIZE = 2 * MiB; + +// Treat the heap as logically separate from .bss +__attribute__((section(".heap"))) static u8 initial_kmalloc_memory[INITIAL_KMALLOC_MEMORY_SIZE]; namespace std { const nothrow_t nothrow; @@ -305,9 +308,6 @@ struct KmallocGlobalData { READONLY_AFTER_INIT static KmallocGlobalData* g_kmalloc_global; alignas(KmallocGlobalData) static u8 g_kmalloc_global_heap[sizeof(KmallocGlobalData)]; -// Treat the heap as logically separate from .bss -__attribute__((section(".heap"))) static u8 kmalloc_pool_heap[POOL_SIZE]; - static size_t g_kmalloc_call_count; static size_t g_kfree_call_count; static size_t g_nested_kfree_calls; @@ -329,8 +329,8 @@ static inline void kmalloc_verify_nospinlock_held() UNMAP_AFTER_INIT void kmalloc_init() { // Zero out heap since it's placed after end_of_kernel_bss. - memset(kmalloc_pool_heap, 0, sizeof(kmalloc_pool_heap)); - g_kmalloc_global = new (g_kmalloc_global_heap) KmallocGlobalData(kmalloc_pool_heap, sizeof(kmalloc_pool_heap)); + memset(initial_kmalloc_memory, 0, sizeof(initial_kmalloc_memory)); + g_kmalloc_global = new (g_kmalloc_global_heap) KmallocGlobalData(initial_kmalloc_memory, sizeof(initial_kmalloc_memory)); s_lock.initialize(); }