diff options
| author | 2020-06-10 14:49:00 +1000 | |
|---|---|---|
| committer | 2020-06-10 14:49:00 +1000 | |
| commit | 74ff1db758a67601b2fa02ea1668ec05f1c5e2ff (patch) | |
| tree | 698a8d438dfdcff995ce4938b07107c73d833079 /src | |
| parent | Merge pull request #4027 from ReinUsesLisp/3d-slices (diff) | |
| download | yuzu-74ff1db758a67601b2fa02ea1668ec05f1c5e2ff.tar.gz yuzu-74ff1db758a67601b2fa02ea1668ec05f1c5e2ff.tar.xz yuzu-74ff1db758a67601b2fa02ea1668ec05f1c5e2ff.zip | |
kernel: Account for system resource size for memory usage
GetTotalPhysicalMemoryAvailableWithoutSystemResource & GetTotalPhysicalMemoryUsedWithoutSystemResource seem to subtract the resource size from the usage.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 36724569f..c4c5199b1 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -132,7 +132,8 @@ std::shared_ptr<ResourceLimit> Process::GetResourceLimit() const { | |||
| 132 | 132 | ||
| 133 | u64 Process::GetTotalPhysicalMemoryAvailable() const { | 133 | u64 Process::GetTotalPhysicalMemoryAvailable() const { |
| 134 | const u64 capacity{resource_limit->GetCurrentResourceValue(ResourceType::PhysicalMemory) + | 134 | const u64 capacity{resource_limit->GetCurrentResourceValue(ResourceType::PhysicalMemory) + |
| 135 | page_table->GetTotalHeapSize() + image_size + main_thread_stack_size}; | 135 | page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + |
| 136 | main_thread_stack_size}; | ||
| 136 | 137 | ||
| 137 | if (capacity < memory_usage_capacity) { | 138 | if (capacity < memory_usage_capacity) { |
| 138 | return capacity; | 139 | return capacity; |
| @@ -146,7 +147,8 @@ u64 Process::GetTotalPhysicalMemoryAvailableWithoutSystemResource() const { | |||
| 146 | } | 147 | } |
| 147 | 148 | ||
| 148 | u64 Process::GetTotalPhysicalMemoryUsed() const { | 149 | u64 Process::GetTotalPhysicalMemoryUsed() const { |
| 149 | return image_size + main_thread_stack_size + page_table->GetTotalHeapSize(); | 150 | return image_size + main_thread_stack_size + page_table->GetTotalHeapSize() + |
| 151 | GetSystemResourceSize(); | ||
| 150 | } | 152 | } |
| 151 | 153 | ||
| 152 | u64 Process::GetTotalPhysicalMemoryUsedWithoutSystemResource() const { | 154 | u64 Process::GetTotalPhysicalMemoryUsedWithoutSystemResource() const { |