diff options
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/arch/memory/heap/global_heap_allocator.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86_64/include/arch/memory/heap/global_heap_allocator.hpp b/arch/x86_64/include/arch/memory/heap/global_heap_allocator.hpp index f391936..a4ece57 100644 --- a/arch/x86_64/include/arch/memory/heap/global_heap_allocator.hpp +++ b/arch/x86_64/include/arch/memory/heap/global_heap_allocator.hpp @@ -5,6 +5,13 @@ namespace teachos::arch::memory::heap { + enum class heap_allocator_type : uint8_t + { + NONE, + BUMP, + LINKED_LIST + }; + struct global_heap_allocator { static auto allocate(std::size_t size) -> void *; @@ -12,7 +19,11 @@ namespace teachos::arch::memory::heap static auto deallocate(void * pointer, std::size_t size) -> void; private: - static auto get_underlying_allocator() -> linked_list_allocator &; + static heap_allocator_type allocator_type; + + static auto register_heap_allocator_type(heap_allocator_type new_type) -> void; + + static auto create_or_get() -> linked_list_allocator &; }; } // namespace teachos::arch::memory::heap |
