mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
Use VMAHandle.Contains()
Why do extra math when we have a function specifically for this?
This commit is contained in:
parent
5a455c97de
commit
21e8fb2e20
@ -302,7 +302,7 @@ int MemoryManager::PoolCommit(VAddr virtual_addr, size_t size, MemoryProt prot)
|
|||||||
VAddr mapped_addr = Common::AlignUp(virtual_addr, alignment);
|
VAddr mapped_addr = Common::AlignUp(virtual_addr, alignment);
|
||||||
|
|
||||||
auto& vma = FindVMA(mapped_addr)->second;
|
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
|
// If the VMA isn't PoolReserved or if there's not enough space to commit, return EINVAL
|
||||||
LOG_ERROR(Kernel_Vmm,
|
LOG_ERROR(Kernel_Vmm,
|
||||||
"Pooled region {:#x} to {:#x} is not large enough to commit from {:#x} to {:#x}",
|
"Pooled region {:#x} to {:#x} is not large enough to commit from {:#x} to {:#x}",
|
||||||
|
Loading…
Reference in New Issue
Block a user