1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

Kernel: Add FIXME about allocation waste in kmalloc slabheap

This commit is contained in:
Andreas Kling 2021-12-26 18:47:20 +01:00
parent 43099fb387
commit 66d35f2936

View file

@ -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!