kern: General system stability improvements to enhance the user's experience.

This commit is contained in:
Michael Scire authored and SciresM committed 2020-07-31 14:50:52 -07:00
1 parent 2ad9927a88
commit 583899ede3
5 files changed
+20 -4

No files matched your search

@@ -105,6 +105,9 @@ namespace ams::kern {
/* Clear our tracking variables. */
this->system_resource_address = Null<KVirtualAddress>;
this->system_resource_num_pages = 0;
/* Finalize optimized memory. If memory wasn't optimized, this is a no-op. */
Kernel::GetMemoryManager().FinalizeOptimizedMemory(this->GetId(), this->memory_pool);
}
/* Release memory to the resource limit. */
@@ -359,7 +362,7 @@ namespace ams::kern {
MESOSPHERE_ABORT_UNLESS(this->process_id <= ProcessIdMax);
/* If we should optimize memory allocations, do so. */
if (this->system_resource_address != Null<KVirtualAddress>) {
if (this->system_resource_address != Null<KVirtualAddress> && (params.flags & ams::svc::CreateProcessFlag_OptimizeMemoryAllocation) != 0) {
R_TRY(Kernel::GetMemoryManager().InitializeOptimizedMemory(this->process_id, pool));
}