mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 10:04:39 +00:00
Update memory.cpp
This commit is contained in:
parent
3c734e7779
commit
2c55d014c0
@ -797,14 +797,14 @@ VAddr MemoryManager::SearchFree(VAddr virtual_addr, size_t size, u32 alignment)
|
|||||||
virtual_addr = Common::AlignUp(virtual_addr, alignment);
|
virtual_addr = Common::AlignUp(virtual_addr, alignment);
|
||||||
auto it = FindVMA(virtual_addr);
|
auto it = FindVMA(virtual_addr);
|
||||||
|
|
||||||
// If the VMA is free and contains the requested mapping we are done.
|
// If the VMA is not mapped and contains the requested mapping, we are done.
|
||||||
if (it->second.IsFree() && it->second.Contains(virtual_addr, size)) {
|
if (!it->second.IsMapped() && it->second.Contains(virtual_addr, size)) {
|
||||||
return virtual_addr;
|
return virtual_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for the first free VMA that fits our mapping.
|
// Search for the first free VMA that fits our mapping.
|
||||||
while (it != vma_map.end()) {
|
while (it != vma_map.end()) {
|
||||||
if (!it->second.IsFree()) {
|
if (it->second.IsMapped()) {
|
||||||
it++;
|
it++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user