summaryrefslogtreecommitdiff
path: root/Kernel/VM/MemoryManager.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-08 10:43:44 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-08 11:11:22 +0200
commita96d76fd907027994d382d99309b7b3af911b8a4 (patch)
tree4566a99c137da9d9c5daa0e146fa79b729a3dbd0 /Kernel/VM/MemoryManager.cpp
parentfffd3a67adecc26a631515b4d89f8ca8199b5eda (diff)
downloadserenity-a96d76fd907027994d382d99309b7b3af911b8a4.zip
Kernel: Put all VMObjects in an InlineLinkedList instead of a HashTable
Using a HashTable to track "all instances of Foo" is only useful if we actually need to look up entries by some kind of index. And since they are HashTable (not HashMap), the pointer *is* the index. Since we have the pointer, we can just use it directly. Duh. This increase sizeof(VMObject) by two pointers, but removes a global table that had an entry for every VMObject, where the cost was higher. It also avoids all the general hash tabling business when creating or destroying VMObjects. Generally we should do more of this. :^)
Diffstat (limited to 'Kernel/VM/MemoryManager.cpp')
-rw-r--r--Kernel/VM/MemoryManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/VM/MemoryManager.cpp b/Kernel/VM/MemoryManager.cpp
index f010faddb9..143dd6c495 100644
--- a/Kernel/VM/MemoryManager.cpp
+++ b/Kernel/VM/MemoryManager.cpp
@@ -753,13 +753,13 @@ bool MemoryManager::validate_user_write(const Process& process, VirtualAddress v
void MemoryManager::register_vmo(VMObject& vmo)
{
InterruptDisabler disabler;
- m_vmos.set(&vmo);
+ m_vmobjects.append(&vmo);
}
void MemoryManager::unregister_vmo(VMObject& vmo)
{
InterruptDisabler disabler;
- m_vmos.remove(&vmo);
+ m_vmobjects.remove(&vmo);
}
void MemoryManager::register_region(Region& region)