From c76ffa501996ba2597b34ebb3b502a9c8d5dc30a Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Sat, 11 Jan 2020 13:52:34 +0100 Subject: core/kernel: Fix GetTotalPhysicalMemoryUsed. module._memory was already moved over to a new shared_ptr. So code_memory_size was not increased at all. This lowers the heap space and so saves a bit of memory, usually between 50 to 100 MB. This fixes a regression of c0a01f3adc466d07fc27020048e82cca60988970 --- src/core/hle/kernel/process.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 12ea4ebe3..b9035a0be 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -317,6 +317,8 @@ void Process::FreeTLSRegion(VAddr tls_address) { } void Process::LoadModule(CodeSet module_, VAddr base_addr) { + code_memory_size += module_.memory.size(); + const auto memory = std::make_shared(std::move(module_.memory)); const auto MapSegment = [&](const CodeSet::Segment& segment, VMAPermission permissions, @@ -332,8 +334,6 @@ void Process::LoadModule(CodeSet module_, VAddr base_addr) { MapSegment(module_.CodeSegment(), VMAPermission::ReadExecute, MemoryState::Code); MapSegment(module_.RODataSegment(), VMAPermission::Read, MemoryState::CodeData); MapSegment(module_.DataSegment(), VMAPermission::ReadWrite, MemoryState::CodeData); - - code_memory_size += module_.memory.size(); } Process::Process(Core::System& system) -- cgit v1.2.3