1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

Kernel: Remove the limited use of AK::TypeTraits we had in the kernel

This was only used for VMObject and we can do without it there. This is
preparation for migrating to dynamic_cast-based helpers in userspace.
This commit is contained in:
Andreas Kling 2021-01-01 15:32:06 +01:00
parent aa92adeedf
commit 7c3b6b10e4
7 changed files with 10 additions and 23 deletions

View file

@ -42,8 +42,9 @@ int Process::sys$purge(int mode)
NonnullRefPtrVector<PurgeableVMObject> vmobjects;
{
InterruptDisabler disabler;
MM.for_each_vmobject_of_type<PurgeableVMObject>([&](auto& vmobject) {
vmobjects.append(vmobject);
MM.for_each_vmobject([&](auto& vmobject) {
if (vmobject.is_purgeable())
vmobjects.append(static_cast<PurgeableVMObject&>(vmobject));
return IterationDecision::Continue;
});
}
@ -55,8 +56,9 @@ int Process::sys$purge(int mode)
NonnullRefPtrVector<InodeVMObject> vmobjects;
{
InterruptDisabler disabler;
MM.for_each_vmobject_of_type<InodeVMObject>([&](auto& vmobject) {
vmobjects.append(vmobject);
MM.for_each_vmobject([&](auto& vmobject) {
if (vmobject.is_inode())
vmobjects.append(static_cast<InodeVMObject&>(vmobject));
return IterationDecision::Continue;
});
}