mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-06 10:43:16 +00:00
Fixed return strict const iterator, replace to range-based loop C++17 and code refactor (#548)
Signed-off-by: Herman Semenov <GermanAizek@yandex.ru> Co-authored-by: georgemoralis <giorgosmrls@gmail.com>
This commit is contained in:
parent
9814a1b788
commit
96ea686eb6
8 changed files with 31 additions and 32 deletions
|
@ -98,7 +98,7 @@ PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, size_t size,
|
|||
return dmem_area->second.is_free && remaining_size >= size;
|
||||
};
|
||||
while (!is_suitable() && dmem_area->second.GetEnd() <= search_end) {
|
||||
dmem_area++;
|
||||
++dmem_area;
|
||||
}
|
||||
ASSERT_MSG(is_suitable(), "Unable to find free direct memory area: size = {:#x}", size);
|
||||
|
||||
|
@ -487,7 +487,7 @@ int MemoryManager::VirtualQuery(VAddr addr, int flags,
|
|||
|
||||
auto it = FindVMA(addr);
|
||||
if (it->second.type == VMAType::Free && flags == 1) {
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
if (it->second.type == VMAType::Free) {
|
||||
LOG_WARNING(Kernel_Vmm, "VirtualQuery on free memory region");
|
||||
|
@ -603,7 +603,7 @@ VAddr MemoryManager::SearchFree(VAddr virtual_addr, size_t size, u32 alignment)
|
|||
return remaining_size >= size;
|
||||
};
|
||||
while (!is_suitable()) {
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
return virtual_addr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue