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

Kernel: Store VMObject physical pages in a FixedArray

Let's enforce the invariant that VMObjects don't shrink or grow by
storing the pages in a FixedArray.
This commit is contained in:
Andreas Kling 2021-07-11 17:38:28 +02:00
parent 373b8d7cfa
commit 59049ae4b7
3 changed files with 6 additions and 11 deletions

View file

@ -15,14 +15,9 @@ VMObject::VMObject(const VMObject& other)
MM.register_vmobject(*this);
}
VMObject::VMObject()
{
MM.register_vmobject(*this);
}
VMObject::VMObject(size_t size)
: m_physical_pages(ceil_div(size, static_cast<size_t>(PAGE_SIZE)))
{
m_physical_pages.resize(ceil_div(size, static_cast<size_t>(PAGE_SIZE)));
MM.register_vmobject(*this);
}