From 6c4ce82c3f9cc920bcde74fc10fdfd39b477b9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Thu, 20 Feb 2025 10:41:11 +0000 Subject: Fix compilation issues --- .../arch/memory/heap/global_heap_allocator.hpp | 33 ++++++---------------- 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'arch/x86_64/include') 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 b7b2073..871f4f8 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 @@ -10,37 +10,22 @@ namespace teachos::arch::memory::heap static auto allocate(std::size_t size) -> void *; static auto deallocate(void * pointer, std::size_t size) -> void; + + private: + static linked_list_allocator allocator; }; } // namespace teachos::arch::memory::heap -auto operator new(std::size_t size) -> void * -{ - return teachos::arch::memory::heap::global_heap_allocator::allocate(size); -} +auto operator new(std::size_t size) -> void *; -auto operator delete(void * pointer) noexcept -> void -{ - teachos::arch::memory::heap::global_heap_allocator::deallocate(pointer, 64); -} +auto operator delete(void * pointer) noexcept -> void; -auto operator delete(void * pointer, std::size_t size) noexcept -> void -{ - teachos::arch::memory::heap::global_heap_allocator::deallocate(pointer, size); -} +auto operator delete(void * pointer, std::size_t size) noexcept -> void; -auto operator new[](std::size_t size) -> void * -{ - return teachos::arch::memory::heap::global_heap_allocator::allocate(size); -} +auto operator new[](std::size_t size) -> void *; -auto operator delete[](void * pointer) noexcept -> void -{ - teachos::arch::memory::heap::global_heap_allocator::deallocate(pointer, 64); -} +auto operator delete[](void * pointer) noexcept -> void; -auto operator delete[](void * pointer, std::size_t size) noexcept -> void -{ - teachos::arch::memory::heap::global_heap_allocator::deallocate(pointer, size); -} +auto operator delete[](void * pointer, std::size_t size) noexcept -> void; #endif // TEACHOS_ARCH_X86_64_MEMORY_HEAP_GLOBAL_HEAP_ALLOCATOR_HPP -- cgit v1.2.3