summaryrefslogtreecommitdiff
path: root/Kernel/Memory/AddressSpace.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-04-05 11:57:53 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-05 11:57:53 +0200
commitda7ea2556e2dc2b027609feec35204b12693afd4 (patch)
tree7a67b342e4c90b980b58e28218ca34bfe1192100 /Kernel/Memory/AddressSpace.cpp
parent4b5a9bab344bfa03461139e56fd3ddbe6e8f48e3 (diff)
downloadserenity-da7ea2556e2dc2b027609feec35204b12693afd4.zip
Kernel: Add RegionTree::remove(Region&)
This allows clients to remove a region from the tree without reaching into the RegionTree internals.
Diffstat (limited to 'Kernel/Memory/AddressSpace.cpp')
-rw-r--r--Kernel/Memory/AddressSpace.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Kernel/Memory/AddressSpace.cpp b/Kernel/Memory/AddressSpace.cpp
index d4cd3bafad..5e84decbdd 100644
--- a/Kernel/Memory/AddressSpace.cpp
+++ b/Kernel/Memory/AddressSpace.cpp
@@ -229,9 +229,7 @@ void AddressSpace::deallocate_region(Region& region)
NonnullOwnPtr<Region> AddressSpace::take_region(Region& region)
{
- SpinlockLocker lock(m_lock);
- SpinlockLocker tree_locker(m_region_tree.get_lock());
- auto did_remove = m_region_tree.regions().remove(region.vaddr().get());
+ auto did_remove = m_region_tree.remove(region);
VERIFY(did_remove);
return NonnullOwnPtr { NonnullOwnPtr<Region>::Adopt, region };
}