From 497c759ab773b73a2f66a82ad13901b9178ee49e Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Wed, 7 Apr 2021 02:17:05 +0300 Subject: Kernel: Remove old region from process' regions vector before splitting This does not affect functionality right now, but it means that the regions vector will now never have any overlapping regions, which will allow the use of balance binary search trees instead of a vector in the future. (since they require keys to be exclusive) --- Kernel/VM/Space.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Kernel/VM/Space.h') diff --git a/Kernel/VM/Space.h b/Kernel/VM/Space.h index dde64230dc..fd5ae428b1 100644 --- a/Kernel/VM/Space.h +++ b/Kernel/VM/Space.h @@ -58,6 +58,7 @@ public: KResultOr allocate_region_with_vmobject(const Range&, NonnullRefPtr, size_t offset_in_vmobject, const String& name, int prot, bool shared); KResultOr allocate_region(const Range&, const String& name, int prot = PROT_READ | PROT_WRITE, AllocationStrategy strategy = AllocationStrategy::Reserve); bool deallocate_region(Region& region); + OwnPtr take_region(Region& region); Region& allocate_split_region(const Region& source_region, const Range&, size_t offset_in_vmobject); Vector split_region_around_range(const Region& source_region, const Range&); -- cgit v1.2.3