mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
b67200dfea
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.
22 lines
442 B
C++
22 lines
442 B
C++
#include <Kernel/FileSystem/FileSystem.h>
|
|
#include <Kernel/FileSystem/Inode.h>
|
|
#include <Kernel/VM/MemoryManager.h>
|
|
#include <Kernel/VM/VMObject.h>
|
|
|
|
VMObject::VMObject(const VMObject& other)
|
|
: m_physical_pages(other.m_physical_pages)
|
|
{
|
|
MM.register_vmo(*this);
|
|
}
|
|
|
|
VMObject::VMObject(size_t size)
|
|
: m_physical_pages(ceil_div(size, PAGE_SIZE))
|
|
{
|
|
MM.register_vmo(*this);
|
|
}
|
|
|
|
VMObject::~VMObject()
|
|
{
|
|
MM.unregister_vmo(*this);
|
|
}
|