mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48: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:
parent
373b8d7cfa
commit
59049ae4b7
3 changed files with 6 additions and 11 deletions
|
@ -117,11 +117,11 @@ AnonymousVMObject::AnonymousVMObject(PhysicalPage& page)
|
|||
}
|
||||
|
||||
AnonymousVMObject::AnonymousVMObject(NonnullRefPtrVector<PhysicalPage> physical_pages)
|
||||
: VMObject()
|
||||
: VMObject(physical_pages.size())
|
||||
, m_volatile_ranges_cache({ 0, page_count() })
|
||||
{
|
||||
for (auto& page : physical_pages) {
|
||||
m_physical_pages.append(page);
|
||||
for (size_t i = 0; i < physical_pages.size(); ++i) {
|
||||
m_physical_pages[i] = physical_pages[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue