From 21e8fb2e2007acd0a830fcdcaae0b889a4ba5684 Mon Sep 17 00:00:00 2001 From: Stephen Miller Date: Fri, 9 May 2025 20:55:47 -0500 Subject: [PATCH] Use VMAHandle.Contains() Why do extra math when we have a function specifically for this? --- src/core/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index fe9400604..c69ca248d 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -302,7 +302,7 @@ int MemoryManager::PoolCommit(VAddr virtual_addr, size_t size, MemoryProt prot) VAddr mapped_addr = Common::AlignUp(virtual_addr, alignment); auto& vma = FindVMA(mapped_addr)->second; - if (vma.type != VMAType::PoolReserved || vma.base + vma.size < virtual_addr + size) { + if (vma.type != VMAType::PoolReserved || !vma.Contains(mapped_addr, size)) { // If the VMA isn't PoolReserved or if there's not enough space to commit, return EINVAL LOG_ERROR(Kernel_Vmm, "Pooled region {:#x} to {:#x} is not large enough to commit from {:#x} to {:#x}",