mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00:00
Kernel: Rename Space::create => Space::try_create()
This commit is contained in:
parent
8f6bc7fd10
commit
a085168c52
4 changed files with 4 additions and 4 deletions
|
@ -261,7 +261,7 @@ Process::Process(const String& name, uid_t uid, gid_t gid, ProcessID ppid, bool
|
||||||
|
|
||||||
KResult Process::attach_resources(RefPtr<Thread>& first_thread, Process* fork_parent)
|
KResult Process::attach_resources(RefPtr<Thread>& first_thread, Process* fork_parent)
|
||||||
{
|
{
|
||||||
m_space = Space::create(*this, fork_parent ? &fork_parent->space() : nullptr);
|
m_space = Space::try_create(*this, fork_parent ? &fork_parent->space() : nullptr);
|
||||||
if (!m_space)
|
if (!m_space)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
||||||
|
|
|
@ -453,7 +453,7 @@ static KResultOr<LoadResult> load_elf_object(NonnullOwnPtr<Space> new_space, Fil
|
||||||
KResultOr<LoadResult> Process::load(NonnullRefPtr<FileDescription> main_program_description,
|
KResultOr<LoadResult> Process::load(NonnullRefPtr<FileDescription> main_program_description,
|
||||||
RefPtr<FileDescription> interpreter_description, const ElfW(Ehdr) & main_program_header)
|
RefPtr<FileDescription> interpreter_description, const ElfW(Ehdr) & main_program_header)
|
||||||
{
|
{
|
||||||
auto new_space = Space::create(*this, nullptr);
|
auto new_space = Space::try_create(*this, nullptr);
|
||||||
if (!new_space)
|
if (!new_space)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
OwnPtr<Space> Space::create(Process& process, const Space* parent)
|
OwnPtr<Space> Space::try_create(Process& process, Space const* parent)
|
||||||
{
|
{
|
||||||
auto page_directory = PageDirectory::create_for_userspace(parent ? &parent->page_directory().range_allocator() : nullptr);
|
auto page_directory = PageDirectory::create_for_userspace(parent ? &parent->page_directory().range_allocator() : nullptr);
|
||||||
if (!page_directory)
|
if (!page_directory)
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace Kernel {
|
||||||
|
|
||||||
class Space {
|
class Space {
|
||||||
public:
|
public:
|
||||||
static OwnPtr<Space> create(Process&, const Space* parent);
|
static OwnPtr<Space> try_create(Process&, Space const* parent);
|
||||||
~Space();
|
~Space();
|
||||||
|
|
||||||
PageDirectory& page_directory() { return *m_page_directory; }
|
PageDirectory& page_directory() { return *m_page_directory; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue