mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-25 12:55:00 +00:00
core/kernel: Miscellaneous memory fixes (#557)
* core/libraries/kernel: Fix inaccurate direct memory size * core/memory: Fix available dmem query on non-free dmem areas * core/kernel: return ENOMEM if memory area size is zero * core/kernel: Fix returns on `sceKernelAvailableDirectMemorySize` * core/memory: Remove unneeded size alignment
This commit is contained in:
parent
5d7407dc7d
commit
fae0c0ae85
3 changed files with 19 additions and 5 deletions
|
@ -328,6 +328,11 @@ int MemoryManager::DirectQueryAvailable(PAddr search_start, PAddr search_end, si
|
|||
PAddr paddr{};
|
||||
size_t max_size{};
|
||||
while (dmem_area != dmem_map.end() && dmem_area->second.GetEnd() <= search_end) {
|
||||
if (!dmem_area->second.is_free) {
|
||||
dmem_area++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dmem_area->second.size > max_size) {
|
||||
paddr = dmem_area->second.base;
|
||||
max_size = dmem_area->second.size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue