1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 21:25:07 +00:00

Kernel: Only remap regions if memory was purged from them

This commit is contained in:
Tom 2020-09-01 13:38:50 -06:00 committed by Andreas Kling
parent 55c4866370
commit eb1cc5d665

View file

@ -82,9 +82,12 @@ int PurgeableVMObject::purge_impl()
}
m_was_purged = true;
for_each_region([&](auto& region) {
region.remap();
});
if (purged_page_count > 0) {
for_each_region([&](auto& region) {
if (&region.vmobject() == this)
region.remap();
});
}
return purged_page_count;
}