diff options
Diffstat (limited to 'arch/x86_64/src/memory')
| -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 |
