2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

core: hle: service: kernel_helpers: Use system resource limit.

This commit is contained in:
bunnei 2022-03-11 00:10:08 -08:00
parent 8873c0c3db
commit bfc4823e36

View file

@ -17,21 +17,12 @@ namespace Service::KernelHelpers {
ServiceContext::ServiceContext(Core::System& system_, std::string name_) ServiceContext::ServiceContext(Core::System& system_, std::string name_)
: kernel(system_.Kernel()) { : kernel(system_.Kernel()) {
// Create a resource limit for the process.
const auto physical_memory_size =
kernel.MemoryManager().GetSize(Kernel::KMemoryManager::Pool::System);
auto* resource_limit = Kernel::CreateResourceLimitForProcess(system_, physical_memory_size);
// Create the process. // Create the process.
process = Kernel::KProcess::Create(kernel); process = Kernel::KProcess::Create(kernel);
ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_), ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_),
Kernel::KProcess::ProcessType::KernelInternal, Kernel::KProcess::ProcessType::KernelInternal,
resource_limit) kernel.GetSystemResourceLimit())
.IsSuccess()); .IsSuccess());
// Close reference to our resource limit, as the process opens one.
resource_limit->Close();
} }
ServiceContext::~ServiceContext() { ServiceContext::~ServiceContext() {