diff options
| author | Fabian Imhof <fabian.imhof@ost.ch> | 2024-12-01 12:07:42 +0000 |
|---|---|---|
| committer | Fabian Imhof <fabian.imhof@ost.ch> | 2024-12-01 12:07:42 +0000 |
| commit | 2671b9522db44418536559524a22c95d3575569e (patch) | |
| tree | 18703f532dfcbef847c0c3af03a42d50c4f36e7c /arch/x86_64/src/memory/heap | |
| parent | b8fd52b6b3a7f002cff58ff8da0313a684cb3ab4 (diff) | |
| download | teachos-2671b9522db44418536559524a22c95d3575569e.tar.xz teachos-2671b9522db44418536559524a22c95d3575569e.zip | |
enable heap test
Diffstat (limited to 'arch/x86_64/src/memory/heap')
| -rw-r--r-- | arch/x86_64/src/memory/heap/linked_list_allocator.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86_64/src/memory/heap/linked_list_allocator.cpp b/arch/x86_64/src/memory/heap/linked_list_allocator.cpp index 3330399..98a936c 100644 --- a/arch/x86_64/src/memory/heap/linked_list_allocator.cpp +++ b/arch/x86_64/src/memory/heap/linked_list_allocator.cpp @@ -90,13 +90,12 @@ namespace teachos::arch::memory::heap } auto linked_list_allocator::coalesce_free_memory_block(memory_block *& previous_block, memory_block *& current_block, - void * pointer, std::size_t size) -> void * + void * pointer, std::size_t size) -> void { auto const start_address = reinterpret_cast<std::size_t>(pointer); auto const end_address = start_address + size; auto block_size = size; - auto new_block_address = pointer; auto next_block = current_block; // If free memory block after block to deallocate is adjacent @@ -118,7 +117,7 @@ namespace teachos::arch::memory::heap return; } - new (reinterpret_cast<void *>(new_block_address)) memory_block(block_size, next_block); + new (reinterpret_cast<void *>(pointer)) memory_block(block_size, next_block); } } // namespace teachos::arch::memory::heap |
