aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/src/memory/heap/linked_list_allocator.cpp6
1 files changed, 4 insertions, 2 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 6600c6e..d0bf8e6 100644
--- a/arch/x86_64/src/memory/heap/linked_list_allocator.cpp
+++ b/arch/x86_64/src/memory/heap/linked_list_allocator.cpp
@@ -36,11 +36,13 @@ namespace teachos::arch::memory::heap
{
if (current->size == size)
{
- return remove_free_memory_block(previous, current);
+ auto const memory_address = remove_free_memory_block(previous, current);
+ mutex.unlock();
+ return memory_address;
}
else if (current->size >= size + min_allocatable_size())
{
- auto memory_address = split_free_memory_block(previous, current, size);
+ auto const memory_address = split_free_memory_block(previous, current, size);
mutex.unlock();
return memory_address;
}