mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:27:45 +00:00
Kernel: Use find_largest_not_above in VirtualRangeAllocator
Instead of iterating over the regions in the tree which is O(n), we can just use RedBlackTree's find_largest_not_above method, which is O(logn)
This commit is contained in:
parent
49259777ef
commit
4174fe0156
2 changed files with 14 additions and 15 deletions
|
@ -31,7 +31,7 @@ public:
|
|||
bool contains(VirtualRange const& range) const { return m_total_range.contains(range); }
|
||||
|
||||
private:
|
||||
void carve_at_iterator(auto&, VirtualRange const&);
|
||||
void carve_from_region(VirtualRange const& from, VirtualRange const&);
|
||||
|
||||
RedBlackTree<FlatPtr, VirtualRange> m_available_ranges;
|
||||
VirtualRange m_total_range;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue