mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
Kernel: Add for_each_vmobject_of_type<T>
This makes iterating over a specific type of VMObjects a bit nicer.
This commit is contained in:
parent
239fd33405
commit
55f61c0004
Notes:
sideshowbarker
2024-07-19 06:49:58 +09:00
Author: https://github.com/awesomekling
Commit: 55f61c0004
8 changed files with 57 additions and 16 deletions
|
@ -125,6 +125,17 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
template<typename T, typename Callback>
|
||||
static void for_each_vmobject_of_type(Callback callback)
|
||||
{
|
||||
for (auto& vmobject : MM.m_vmobjects) {
|
||||
if (!is<T>(vmobject))
|
||||
continue;
|
||||
if (callback(static_cast<T&>(vmobject)) == IterationDecision::Break)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static Region* region_from_vaddr(Process&, VirtualAddress);
|
||||
static const Region* region_from_vaddr(const Process&, VirtualAddress);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue