1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

Kernel: Remove unused Process pointer in Memory::AddressSpace

Nobody was using the back-pointer to the process, so let's lose it.
This commit is contained in:
Andreas Kling 2021-08-07 21:32:30 +02:00
parent 2362ebf483
commit 15d033b486
4 changed files with 8 additions and 10 deletions

View file

@ -15,21 +15,20 @@
namespace Kernel::Memory {
OwnPtr<AddressSpace> AddressSpace::try_create(Process& process, AddressSpace const* parent)
OwnPtr<AddressSpace> AddressSpace::try_create(AddressSpace const* parent)
{
auto page_directory = PageDirectory::try_create_for_userspace(parent ? &parent->page_directory().range_allocator() : nullptr);
if (!page_directory)
return {};
auto space = adopt_own_if_nonnull(new (nothrow) AddressSpace(process, page_directory.release_nonnull()));
auto space = adopt_own_if_nonnull(new (nothrow) AddressSpace(page_directory.release_nonnull()));
if (!space)
return {};
space->page_directory().set_space({}, *space);
return space;
}
AddressSpace::AddressSpace(Process& process, NonnullRefPtr<PageDirectory> page_directory)
: m_process(&process)
, m_page_directory(move(page_directory))
AddressSpace::AddressSpace(NonnullRefPtr<PageDirectory> page_directory)
: m_page_directory(move(page_directory))
{
}