mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-23 01:38:56 +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
Notes:
sideshowbarker
2024-07-18 02:56:36 +09:00
Author: https://github.com/IdanHo
Commit: 4174fe0156
Pull-request: https://github.com/SerenityOS/serenity/pull/10396
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