Luna/kernel/src/memory/Heap.cpp

15 lines
389 B
C++

#include "memory/Heap.h"
#include "arch/MMU.h"
#include "memory/MemoryManager.h"
#include <luna/Heap.h>
Result<void*> allocate_pages_impl(usize count)
{
return (void*)TRY(MemoryManager::alloc_for_kernel(count, MMU::ReadWrite | MMU::NoExecute));
}
Result<void> release_pages_impl(void* address, usize count)
{
return MemoryManager::unmap_owned_and_free_vm((u64)address, count);
}