mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 20:37:35 +00:00
Kernel: Use a FixedArray for VMObject::m_physical_pages
This makes VMObject 8 bytes smaller since we can use the array size as the page count. The size() is now also computed from the page count instead of being a separate value. This makes sizes always be a multiple of PAGE_SIZE, which is sane.
This commit is contained in:
parent
5096eaa845
commit
b67200dfea
5 changed files with 19 additions and 39 deletions
|
@ -4,18 +4,15 @@
|
|||
#include <Kernel/VM/VMObject.h>
|
||||
|
||||
VMObject::VMObject(const VMObject& other)
|
||||
: m_size(other.m_size)
|
||||
, m_physical_pages(other.m_physical_pages)
|
||||
: m_physical_pages(other.m_physical_pages)
|
||||
{
|
||||
MM.register_vmo(*this);
|
||||
}
|
||||
|
||||
VMObject::VMObject(size_t size, ShouldFillPhysicalPages should_fill_physical_pages)
|
||||
: m_size(size)
|
||||
VMObject::VMObject(size_t size)
|
||||
: m_physical_pages(ceil_div(size, PAGE_SIZE))
|
||||
{
|
||||
MM.register_vmo(*this);
|
||||
if (should_fill_physical_pages == ShouldFillPhysicalPages::Yes)
|
||||
m_physical_pages.resize(page_count());
|
||||
}
|
||||
|
||||
VMObject::~VMObject()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue