aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorMatteo Gmür <matteo.gmuer1@ost.ch>2025-05-12 08:50:12 +0000
committerMatteo Gmür <matteo.gmuer1@ost.ch>2025-05-12 08:50:12 +0000
commitee4c61f7313fedd23d01c69ea5036fa38ef6248a (patch)
treecacb52db9b5233794c6284d14ef9306a045f5d72 /arch/x86_64/include
parentef156dd6430855434b54275b22cd43ee3cedcfdc (diff)
downloadteachos-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.hpp6
-rw-r--r--arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp12
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