mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Kernel: Merge PurgeableVMObject into AnonymousVMObject
This implements memory commitments and lazy-allocation of committed memory.
This commit is contained in:
parent
b2a52f6208
commit
476f17b3f1
35 changed files with 937 additions and 564 deletions
|
@ -26,9 +26,9 @@
|
|||
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/VM/AnonymousVMObject.h>
|
||||
#include <Kernel/VM/InodeVMObject.h>
|
||||
#include <Kernel/VM/MemoryManager.h>
|
||||
#include <Kernel/VM/PurgeableVMObject.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -39,12 +39,11 @@ int Process::sys$purge(int mode)
|
|||
return -EPERM;
|
||||
int purged_page_count = 0;
|
||||
if (mode & PURGE_ALL_VOLATILE) {
|
||||
NonnullRefPtrVector<PurgeableVMObject> vmobjects;
|
||||
NonnullRefPtrVector<AnonymousVMObject> vmobjects;
|
||||
{
|
||||
InterruptDisabler disabler;
|
||||
MM.for_each_vmobject([&](auto& vmobject) {
|
||||
if (vmobject.is_purgeable())
|
||||
vmobjects.append(static_cast<PurgeableVMObject&>(vmobject));
|
||||
vmobjects.append(vmobject);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue