summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2022-03-11 00:10:08 -0800
committerGravatar bunnei2022-03-14 18:14:53 -0700
commitbfc4823e36b0f6f33176c8fcee1309d0f5f40389 (patch)
tree70d1da892a783b240fd0df1b73ac42ce6075a45e /src/core
parentcore: hle: service: sm: Fix KPort reference count. (diff)
downloadyuzu-bfc4823e36b0f6f33176c8fcee1309d0f5f40389.tar.gz
yuzu-bfc4823e36b0f6f33176c8fcee1309d0f5f40389.tar.xz
yuzu-bfc4823e36b0f6f33176c8fcee1309d0f5f40389.zip
core: hle: service: kernel_helpers: Use system resource limit.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/kernel_helpers.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/core/hle/service/kernel_helpers.cpp b/src/core/hle/service/kernel_helpers.cpp
index b8c2c6e51..ff0bbb788 100644
--- a/src/core/hle/service/kernel_helpers.cpp
+++ b/src/core/hle/service/kernel_helpers.cpp
@@ -17,21 +17,12 @@ namespace Service::KernelHelpers {
17 17
18ServiceContext::ServiceContext(Core::System& system_, std::string name_) 18ServiceContext::ServiceContext(Core::System& system_, std::string name_)
19 : kernel(system_.Kernel()) { 19 : kernel(system_.Kernel()) {
20
21 // Create a resource limit for the process.
22 const auto physical_memory_size =
23 kernel.MemoryManager().GetSize(Kernel::KMemoryManager::Pool::System);
24 auto* resource_limit = Kernel::CreateResourceLimitForProcess(system_, physical_memory_size);
25
26 // Create the process. 20 // Create the process.
27 process = Kernel::KProcess::Create(kernel); 21 process = Kernel::KProcess::Create(kernel);
28 ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_), 22 ASSERT(Kernel::KProcess::Initialize(process, system_, std::move(name_),
29 Kernel::KProcess::ProcessType::KernelInternal, 23 Kernel::KProcess::ProcessType::KernelInternal,
30 resource_limit) 24 kernel.GetSystemResourceLimit())
31 .IsSuccess()); 25 .IsSuccess());
32
33 // Close reference to our resource limit, as the process opens one.
34 resource_limit->Close();
35} 26}
36 27
37ServiceContext::~ServiceContext() { 28ServiceContext::~ServiceContext() {