From f2be980a936c87dc83467136291bc72733d451de Mon Sep 17 00:00:00 2001 From: Stephen Miller Date: Tue, 7 Jan 2025 12:33:32 -0600 Subject: [PATCH] Ignore free memory pages --- src/core/memory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 7f1506374..f5bb8b4cb 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -395,12 +395,16 @@ s32 MemoryManager::UnmapMemoryImpl(VAddr virtual_addr, size_t size) { ASSERT_MSG(vma_base.Contains(virtual_addr, size), "Existing mapping does not contain requested unmap range"); + const auto type = vma_base.type; + if (type == VMAType::Free) { + return ORBIS_OK; + } + const auto vma_base_addr = vma_base.base; const auto vma_base_size = vma_base.size; const auto phys_base = vma_base.phys_base; const bool is_exec = vma_base.is_exec; const auto start_in_vma = virtual_addr - vma_base_addr; - const auto type = vma_base.type; const bool has_backing = type == VMAType::Direct || type == VMAType::File; if (type == VMAType::Direct) { rasterizer->UnmapMemory(virtual_addr, size);