From d5c91fa02cfcef793554a6bedad1e07e417d23c2 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 31 Aug 2023 00:17:30 -0700 Subject: [PATCH] Debugger: Reduce cost of small copy tracking. This uses another 400KB RAM and does a bit more writing, but makes lookups faster. --- Core/Debugger/MemBlockInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Debugger/MemBlockInfo.cpp b/Core/Debugger/MemBlockInfo.cpp index 476d62fe34..93f44f41d0 100644 --- a/Core/Debugger/MemBlockInfo.cpp +++ b/Core/Debugger/MemBlockInfo.cpp @@ -57,7 +57,7 @@ private: }; static constexpr uint32_t MAX_SIZE = 0x40000000; - static constexpr uint32_t SLICES = 16384; + static constexpr uint32_t SLICES = 65536; static constexpr uint32_t SLICE_SIZE = MAX_SIZE / SLICES; Slab *FindSlab(uint32_t addr); @@ -371,7 +371,7 @@ void MemSlabMap::FillHeads(Slab *slab) { void FlushPendingMemInfo() { std::lock_guard guard(pendingMutex); - for (auto info : pendingNotifies) { + for (const auto &info : pendingNotifies) { if (info.flags & MemBlockFlags::ALLOC) { allocMap.Mark(info.start, info.size, info.ticks, info.pc, true, info.tag); } else if (info.flags & MemBlockFlags::FREE) {