From 66d35f29366f197866c6d7b1caca6a6d025fd378 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 26 Dec 2021 18:47:20 +0100 Subject: [PATCH] Kernel: Add FIXME about allocation waste in kmalloc slabheap --- Kernel/Heap/kmalloc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp index 5650b45ab8..f19c4354c9 100644 --- a/Kernel/Heap/kmalloc.cpp +++ b/Kernel/Heap/kmalloc.cpp @@ -105,6 +105,8 @@ public: void* allocate() { if (m_usable_blocks.is_empty()) { + // FIXME: This allocation wastes `block_size` bytes due to the implementation of kmalloc_aligned(). + // Handle this with a custom VM+page allocator instead of using kmalloc_aligned(). auto* slot = kmalloc_aligned(KmallocSlabBlock::block_size, KmallocSlabBlock::block_size); if (!slot) { // FIXME: Dare to return nullptr!