mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
Kernel: Remove false condition in RegionTree::allocate_range_specific
Since find_largest_not_above returns the highest region that is below the end of the request range, no region after it can intersect with it.
This commit is contained in:
parent
f943e97b76
commit
30e6b313b4
Notes:
sideshowbarker
2024-07-17 18:08:55 +09:00
Author: https://github.com/IdanHo
Commit: 30e6b313b4
Pull-request: https://github.com/SerenityOS/serenity/pull/13490
1 changed files with 0 additions and 14 deletions
|
@ -101,20 +101,6 @@ ErrorOr<VirtualRange> RegionTree::allocate_range_specific(VirtualAddress base, s
|
|||
return ENOMEM;
|
||||
}
|
||||
|
||||
auto it = m_regions.begin_from(region->vaddr().get());
|
||||
VERIFY(!it.is_end());
|
||||
++it;
|
||||
|
||||
if (it.is_end()) {
|
||||
// The range can be accommodated above the nearest range.
|
||||
return range;
|
||||
}
|
||||
|
||||
if (it->range().intersects(range)) {
|
||||
// Requested range overlaps the next neighbor.
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
// Requested range fits between first region and its next neighbor.
|
||||
return range;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue