mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
Kernel: Use an IntrusiveRedBlackTree for kernel regions
We were already using a non-intrusive RedBlackTree, and since the kernel regions tree is non-owning, this is a trivial conversion that makes a bunch of the tree operations infallible (by being allocation-free.) :^)
This commit is contained in:
parent
66e72ed5e6
commit
df34f7b90b
3 changed files with 13 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/Concepts.h>
|
||||
#include <AK/HashTable.h>
|
||||
#include <AK/IntrusiveRedBlackTree.h>
|
||||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <Kernel/Forward.h>
|
||||
|
@ -293,7 +294,7 @@ private:
|
|||
PhysicalPageEntry* m_physical_page_entries { nullptr };
|
||||
size_t m_physical_page_entries_count { 0 };
|
||||
|
||||
RedBlackTree<FlatPtr, Region*> m_kernel_regions;
|
||||
IntrusiveRedBlackTree<&Region::m_tree_node> m_kernel_regions;
|
||||
|
||||
Vector<UsedMemoryRange> m_used_memory_ranges;
|
||||
Vector<PhysicalMemoryRange> m_physical_memory_ranges;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue