mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 08:06:11 +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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user