mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
f820917a76
This commit converts naked `new`s to `AK::try_make` and `AK::try_create` wherever possible. If the called constructor is private, this can not be done, so we instead now use the standard-defined and compiler-agnostic `new (nothrow)`.
36 lines
791 B
C++
36 lines
791 B
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <Kernel/FileSystem/Inode.h>
|
|
#include <Kernel/VM/PrivateInodeVMObject.h>
|
|
|
|
namespace Kernel {
|
|
|
|
RefPtr<PrivateInodeVMObject> PrivateInodeVMObject::create_with_inode(Inode& inode)
|
|
{
|
|
return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(inode, inode.size()));
|
|
}
|
|
|
|
RefPtr<VMObject> PrivateInodeVMObject::clone()
|
|
{
|
|
return adopt_ref_if_nonnull(new (nothrow) PrivateInodeVMObject(*this));
|
|
}
|
|
|
|
PrivateInodeVMObject::PrivateInodeVMObject(Inode& inode, size_t size)
|
|
: InodeVMObject(inode, size)
|
|
{
|
|
}
|
|
|
|
PrivateInodeVMObject::PrivateInodeVMObject(const PrivateInodeVMObject& other)
|
|
: InodeVMObject(other)
|
|
{
|
|
}
|
|
|
|
PrivateInodeVMObject::~PrivateInodeVMObject()
|
|
{
|
|
}
|
|
|
|
}
|