From 845a96f5e6bfbbbeba19bf3df07f0e9de53d9a88 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 29 Oct 2025 11:40:49 +0100 Subject: kapi: export frame_allocator interface --- arch/x86_64/include/x86_64/memory/region_allocator.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/x86_64/include') diff --git a/arch/x86_64/include/x86_64/memory/region_allocator.hpp b/arch/x86_64/include/x86_64/memory/region_allocator.hpp index a918195..913b0bb 100644 --- a/arch/x86_64/include/x86_64/memory/region_allocator.hpp +++ b/arch/x86_64/include/x86_64/memory/region_allocator.hpp @@ -3,6 +3,7 @@ #include "kapi/memory/address.hpp" #include "kapi/memory/frame.hpp" +#include "kapi/memory/frame_allocator.hpp" #include @@ -15,7 +16,7 @@ namespace teachos::memory::x86_64 * @brief Allocates memory linearly using memory areas read from the multiboot2 information pointer and leaks any * deallocated frames. */ - struct region_allocator + struct region_allocator final : frame_allocator { struct memory_information { @@ -43,7 +44,7 @@ namespace teachos::memory::x86_64 * * @return next free physical frame or nullopt if none was found. */ - auto allocate_frame() -> std::optional; + auto allocate() -> std::optional override; /** * @brief Deallocates a previously allocated physical frame. @@ -54,7 +55,7 @@ namespace teachos::memory::x86_64 * * @param physical_frame Previously allocated physical_frame that should be deallocated. */ - auto deallocate_frame(frame const & physical_frame) -> void; + auto release(frame frame) -> void override; private: /** -- cgit v1.2.3