mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09: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
|
@ -671,9 +671,8 @@ int Process::sys$purge(int mode)
|
|||
NonnullRefPtrVector<PurgeableVMObject> vmobjects;
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
MM.for_each_vmobject([&](auto& vmobject) {
|
||||
if (vmobject.is_purgeable())
|
||||
vmobjects.append(static_cast<PurgeableVMObject&>(vmobject));
|
||||
MM.for_each_vmobject_of_type<PurgeableVMObject>([&](auto& vmobject) {
|
||||
vmobjects.append(vmobject);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
@ -685,9 +684,8 @@ int Process::sys$purge(int mode)
|
|||
NonnullRefPtrVector<InodeVMObject> vmobjects;
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
MM.for_each_vmobject([&](auto& vmobject) {
|
||||
if (vmobject.is_inode())
|
||||
vmobjects.append(static_cast<InodeVMObject&>(vmobject));
|
||||
MM.for_each_vmobject_of_type<InodeVMObject>([&](auto& vmobject) {
|
||||
vmobjects.append(vmobject);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue