From bff6c39a8d4571cd5c41e3926d5fc1428916f32c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Thu, 20 Feb 2025 10:07:03 +0000 Subject: Create global heap allocator attempt --- arch/x86_64/src/memory/heap/global_heap_allocator.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 arch/x86_64/src/memory/heap/global_heap_allocator.cpp (limited to 'arch/x86_64/src/memory') diff --git a/arch/x86_64/src/memory/heap/global_heap_allocator.cpp b/arch/x86_64/src/memory/heap/global_heap_allocator.cpp new file mode 100644 index 0000000..6c31de0 --- /dev/null +++ b/arch/x86_64/src/memory/heap/global_heap_allocator.cpp @@ -0,0 +1,18 @@ + +#include "arch/memory/heap/global_heap_allocator.hpp" + +#include "arch/memory/heap/concept.hpp" + +namespace teachos::arch::memory::heap +{ + auto global_heap_allocator::allocate(std::size_t size) -> void * + { + static linked_list_allocator allocator{HEAP_START, HEAP_START + HEAP_SIZE}; + return allocator.allocate(size); + } + + auto global_heap_allocator::deallocate(void * pointer, std::size_t size) -> void + { + // allocator.deallocate(pointer, size); + } +} // namespace teachos::arch::memory::heap -- cgit v1.2.3