mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
Kernel: Make InodeVMOBject construction OOM-aware
This commit moves the allocation of the resources required for InodeVMObject 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
3879e70447
commit
ad480ff18b
@@ -26,12 +26,12 @@ ErrorOr<NonnullRefPtr<VMObject>> SharedInodeVMObject::try_clone()
|
||||
}
|
||||
|
||||
SharedInodeVMObject::SharedInodeVMObject(Inode& inode, size_t size)
|
||||
: InodeVMObject(inode, size)
|
||||
: InodeVMObject(inode, VMObject::must_create_physical_pages_but_fixme_should_propagate_errors(size))
|
||||
{
|
||||
}
|
||||
|
||||
SharedInodeVMObject::SharedInodeVMObject(SharedInodeVMObject const& other)
|
||||
: InodeVMObject(other)
|
||||
: InodeVMObject(other, other.must_clone_physical_pages_but_fixme_should_propagate_errors())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user