Fix unmapping bug

This commit is contained in:
Borchev 2024-08-20 20:07:32 -07:00
parent 6596fe091c
commit fc300b5265
3 changed files with 5 additions and 5 deletions

View file

@ -242,11 +242,11 @@ void MemoryManager::UnmapMemory(VAddr virtual_addr, size_t size) {
vma.disallow_merge = false;
vma.name = "";
MergeAdjacent(vma_map, new_it);
bool readonly = vma.prot == MemoryProt::CpuRead;
bool readonly_file = vma.prot == MemoryProt::CpuRead && type == VMAType::File;
// Unmap the memory region.
impl.Unmap(vma_base_addr, vma_base_size, start_in_vma, start_in_vma + size, phys_base, is_exec,
has_backing, readonly);
has_backing, readonly_file);
TRACK_FREE(virtual_addr, "VMEM");
}