mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
Kernel: Remove double RedBlackTree lookup in VM/Space region removal
We should never request a regions removal that we don't currently own. We currently assert this everywhere else by all callers. Instead lets just push the assert down into the RedBlackTree removal and assume that we will always successfully remove the region.
This commit is contained in:
parent
d879709ec7
commit
c0987453e6
4 changed files with 13 additions and 26 deletions
|
@ -39,8 +39,8 @@ public:
|
|||
|
||||
KResultOr<Region*> allocate_region_with_vmobject(const Range&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, StringView name, int prot, bool shared);
|
||||
KResultOr<Region*> allocate_region(const Range&, StringView name, int prot = PROT_READ | PROT_WRITE, AllocationStrategy strategy = AllocationStrategy::Reserve);
|
||||
bool deallocate_region(Region& region);
|
||||
OwnPtr<Region> take_region(Region& region);
|
||||
void deallocate_region(Region& region);
|
||||
NonnullOwnPtr<Region> take_region(Region& region);
|
||||
|
||||
KResultOr<Region*> try_allocate_split_region(Region const& source_region, Range const&, size_t offset_in_vmobject);
|
||||
KResultOr<Vector<Region*, 2>> try_split_region_around_range(Region const& source_region, Range const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue