mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
Kernel: Add RegionTree::remove(Region&)
This allows clients to remove a region from the tree without reaching into the RegionTree internals.
This commit is contained in:
parent
4b5a9bab34
commit
da7ea2556e
4 changed files with 10 additions and 6 deletions
|
@ -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 };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue