summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
authorCamilleLaVey <camillelavey@citron-emu.org>2025-03-05 11:12:44 -0400
committerCamilleLaVey <camillelavey@citron-emu.org>2025-03-05 11:12:44 -0400
commit031c635095622a35982f7f6faef894df9583e888 (patch)
tree15eff2f503ad0b897d229d6935fd0878d5c946d0 /src/core/memory.cpp
parent90a8165f7740702c5bc9c57a997bb67d229002aa (diff)
arm: corrected declarations
Diffstat (limited to 'src/core/memory.cpp')
-rw-r--r--src/core/memory.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index b32071899..9a77e4ac0 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -1183,9 +1183,9 @@ bool Memory::Remap(u64 guest_addr, u32 size, ArmNce& arm_nce) {
void Memory::ReclaimUnusedMemory(ArmNce& arm_nce) {
std::lock_guard<std::mutex> lock(arm_nce.m_tlb_mutex); // Correct usage of lock_guard
- const auto& tlb_entries = arm_nce.GetTlbEntries();
+ auto& tlb_entries = arm_nce.GetTlbEntries();
- for (const auto& entry : tlb_entries) {
+ for (auto& entry : tlb_entries) {
if (entry.valid && entry.ref_count == 0) {
// Unmap the memory region
UnmapRegion(*impl->current_page_table, entry.guest_addr, entry.size, false);
@@ -1194,7 +1194,7 @@ void Memory::ReclaimUnusedMemory(ArmNce& arm_nce) {
std::free(reinterpret_cast<void*>(entry.host_addr));
// Invalidate the TLB entry
- const_cast<TlbEntry&>(entry).valid = false;
+ entry.valid = false;
LOG_INFO(Core_Memory, "Reclaimed memory for address {:X}", entry.guest_addr);
}