mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user