mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
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. :^)
This commit is contained in:
parent
fffd3a67ad
commit
a96d76fd90
4 changed files with 32 additions and 14 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue