summaryrefslogtreecommitdiff
path: root/Kernel/VM/VMObject.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-11 17:38:28 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-11 17:42:31 +0200
commit59049ae4b760ae0f5cdad0d326eeaca9d2192fb9 (patch)
tree0fb73ad38ffabe9788e31922ed10b0d563cec2e0 /Kernel/VM/VMObject.cpp
parent373b8d7cfa5cc08203a884fdd2026221f76c49b5 (diff)
downloadserenity-59049ae4b760ae0f5cdad0d326eeaca9d2192fb9.zip
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.
Diffstat (limited to 'Kernel/VM/VMObject.cpp')
-rw-r--r--Kernel/VM/VMObject.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/Kernel/VM/VMObject.cpp b/Kernel/VM/VMObject.cpp
index 5908b4a7ce..99cf074b9c 100644
--- a/Kernel/VM/VMObject.cpp
+++ b/Kernel/VM/VMObject.cpp
@@ -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);
}