mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
Kernel: Make Kernel::VMObject allocation functions return KResultOr
This makes for nicer handling of errors compared to checking whether a RefPtr is null. Additionally, this will give way to return different types of errors in the future.
This commit is contained in:
@@ -14,9 +14,9 @@ RefPtr<PrivateInodeVMObject> PrivateInodeVMObject::try_create_with_inode(Inode&
|
||||
return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(inode, inode.size()));
|
||||
}
|
||||
|
||||
RefPtr<VMObject> PrivateInodeVMObject::try_clone()
|
||||
KResultOr<NonnullRefPtr<VMObject>> PrivateInodeVMObject::try_clone()
|
||||
{
|
||||
return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(*this));
|
||||
return adopt_nonnull_ref_or_enomem<VMObject>(new (nothrow) PrivateInodeVMObject(*this));
|
||||
}
|
||||
|
||||
PrivateInodeVMObject::PrivateInodeVMObject(Inode& inode, size_t size)
|
||||
|
||||
Reference in New Issue
Block a user