diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2025-05-12 08:50:12 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2025-05-12 08:50:12 +0000 |
| commit | ee4c61f7313fedd23d01c69ea5036fa38ef6248a (patch) | |
| tree | cacb52db9b5233794c6284d14ef9306a045f5d72 /arch/x86_64/include | |
| parent | ef156dd6430855434b54275b22cd43ee3cedcfdc (diff) | |
| download | teachos-ee4c61f7313fedd23d01c69ea5036fa38ef6248a.tar.xz teachos-ee4c61f7313fedd23d01c69ea5036fa38ef6248a.zip | |
Adjust user heap to lazy allocate heap
Diffstat (limited to 'arch/x86_64/include')
| -rw-r--r-- | arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp | 6 | ||||
| -rw-r--r-- | arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp | 12 |
2 files changed, 5 insertions, 13 deletions
diff --git a/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp b/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp index 377533c..582b4af 100644 --- a/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp +++ b/arch/x86_64/include/arch/memory/heap/linked_list_allocator.hpp @@ -111,10 +111,8 @@ namespace teachos::arch::memory::heap auto coalesce_free_memory_block(memory_block * previous_block, memory_block * current_block, void * pointer, std::size_t size) -> void; - std::size_t heap_start; ///< Start of the allocatable heap area. - std::size_t heap_end; ///< End of the allocatable heap area. - memory_block * first; ///< First free entry in our memory. - stl::mutex mutex; ///< Mutex to ensure only one thread calls allocate or deallocate at once. + memory_block * first; ///< First free entry in our memory. + stl::mutex mutex; ///< Mutex to ensure only one thread calls allocate or deallocate at once. }; } // namespace teachos::arch::memory::heap diff --git a/arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp b/arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp index cadec78..9c04718 100644 --- a/arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp +++ b/arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp @@ -14,12 +14,8 @@ namespace teachos::arch::memory::heap { /** * @brief Constructor. - * - * @param heap_start Start of the allocatable heap area - * @param heap_end End of the allocatable heap area (Start + Size) */ - [[gnu::section(".user_text")]] - user_heap_allocator(std::size_t heap_start, std::size_t heap_end); + user_heap_allocator() = default; /** * @copybrief heap_allocator::allocate @@ -126,10 +122,8 @@ namespace teachos::arch::memory::heap auto coalesce_free_memory_block(memory_block * previous_block, memory_block * current_block, void * pointer, std::size_t size) -> void; - std::size_t heap_start; ///< Start of the allocatable heap area. - std::size_t heap_end; ///< End of the allocatable heap area. - memory_block * first; ///< First free entry in our memory. - stl::mutex mutex; ///< Mutex to ensure only one thread calls allocate or deallocate at once. + memory_block * first = {}; ///< First free entry in our memory. + stl::mutex mutex = {}; ///< Mutex to ensure only one thread calls allocate or deallocate at once. }; } // namespace teachos::arch::memory::heap |
