summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_process.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-12-30 05:30:12 +0100
committerGitHub <noreply@github.com>2021-12-30 05:30:12 +0100
commit5e5827190374946cc906da3a5d2aa586a9721ba0 (patch)
tree201c75203b27a63f9706c1d3297c70f9d1b9ef2c /src/core/hle/kernel/k_process.cpp
parentMerge pull request #7618 from goldenx86/patch-4 (diff)
parentcore: hle: kernel: Updated implementation of svcSetHeapSize. (diff)
downloadyuzu-5e5827190374946cc906da3a5d2aa586a9721ba0.tar
yuzu-5e5827190374946cc906da3a5d2aa586a9721ba0.tar.gz
yuzu-5e5827190374946cc906da3a5d2aa586a9721ba0.tar.bz2
yuzu-5e5827190374946cc906da3a5d2aa586a9721ba0.tar.lz
yuzu-5e5827190374946cc906da3a5d2aa586a9721ba0.tar.xz
yuzu-5e5827190374946cc906da3a5d2aa586a9721ba0.tar.zst
yuzu-5e5827190374946cc906da3a5d2aa586a9721ba0.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_process.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp
index aee313995..73f8bc4fe 100644
--- a/src/core/hle/kernel/k_process.cpp
+++ b/src/core/hle/kernel/k_process.cpp
@@ -172,7 +172,7 @@ void KProcess::DecrementThreadCount() {
u64 KProcess::GetTotalPhysicalMemoryAvailable() const {
const u64 capacity{resource_limit->GetFreeValue(LimitableResource::PhysicalMemory) +
- page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size +
+ page_table->GetNormalMemorySize() + GetSystemResourceSize() + image_size +
main_thread_stack_size};
if (const auto pool_size = kernel.MemoryManager().GetSize(KMemoryManager::Pool::Application);
capacity != pool_size) {
@@ -189,7 +189,7 @@ u64 KProcess::GetTotalPhysicalMemoryAvailableWithoutSystemResource() const {
}
u64 KProcess::GetTotalPhysicalMemoryUsed() const {
- return image_size + main_thread_stack_size + page_table->GetTotalHeapSize() +
+ return image_size + main_thread_stack_size + page_table->GetNormalMemorySize() +
GetSystemResourceSize();
}
@@ -410,8 +410,8 @@ void KProcess::Run(s32 main_thread_priority, u64 stack_size) {
resource_limit->Reserve(LimitableResource::Threads, 1);
resource_limit->Reserve(LimitableResource::PhysicalMemory, main_thread_stack_size);
- const std::size_t heap_capacity{memory_usage_capacity - main_thread_stack_size - image_size};
- ASSERT(!page_table->SetHeapCapacity(heap_capacity).IsError());
+ const std::size_t heap_capacity{memory_usage_capacity - (main_thread_stack_size + image_size)};
+ ASSERT(!page_table->SetMaxHeapSize(heap_capacity).IsError());
ChangeStatus(ProcessStatus::Running);