diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2025-02-20 10:07:03 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2025-02-20 10:07:03 +0000 |
| commit | bff6c39a8d4571cd5c41e3926d5fc1428916f32c (patch) | |
| tree | 311137d6c51e3a78179bbe5a786eb84c5e4435c8 /arch/x86_64/src/memory | |
| parent | 9438c9203b7be20147b990ff05e1d99190d18928 (diff) | |
| download | teachos-bff6c39a8d4571cd5c41e3926d5fc1428916f32c.tar.xz teachos-bff6c39a8d4571cd5c41e3926d5fc1428916f32c.zip | |
Create global heap allocator attempt
Diffstat (limited to 'arch/x86_64/src/memory')
| -rw-r--r-- | arch/x86_64/src/memory/heap/global_heap_allocator.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
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 |
