diff options
| author | 2020-06-14 00:44:34 -0400 | |
|---|---|---|
| committer | 2020-06-14 00:44:34 -0400 | |
| commit | 89d11f22680d81d8b036a87c206a30defec3fe89 (patch) | |
| tree | 520391440e1c1bbc64cfb4a90888a774127af99d /src | |
| parent | Merge pull request #4064 from ReinUsesLisp/invalidate-buffers (diff) | |
| parent | kernel: Account for system resource size for memory usage (diff) | |
| download | yuzu-89d11f22680d81d8b036a87c206a30defec3fe89.tar.gz yuzu-89d11f22680d81d8b036a87c206a30defec3fe89.tar.xz yuzu-89d11f22680d81d8b036a87c206a30defec3fe89.zip | |
Merge pull request #4069 from ogniK5377/total-phys-mem
kernel: Account for system resource size for memory 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 { |