mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
Kernel: Make VMOBject construction OOM-aware
This commit moves the allocation of the resources required for VMObject from its constructors to the constructors of its child classes. We're making this change to give the child classes the chance to expose the fallibility of the allocation.
This commit is contained in:
committed by
Idan Horowitz
parent
64778f9e69
commit
d1f265e851
@@ -10,14 +10,14 @@
|
||||
namespace Kernel::Memory {
|
||||
|
||||
InodeVMObject::InodeVMObject(Inode& inode, size_t size)
|
||||
: VMObject(size)
|
||||
: VMObject(VMObject::must_create_physical_pages_but_fixme_should_propagate_errors(size))
|
||||
, m_inode(inode)
|
||||
, m_dirty_pages(page_count(), false)
|
||||
{
|
||||
}
|
||||
|
||||
InodeVMObject::InodeVMObject(InodeVMObject const& other)
|
||||
: VMObject(other)
|
||||
: VMObject(other.must_clone_physical_pages_but_fixme_should_propagate_errors())
|
||||
, m_inode(other.m_inode)
|
||||
, m_dirty_pages(page_count(), false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user