From 8d58bbb6342f130e2c498b70172c2ddaef619799 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 7 Feb 2021 17:24:55 -0800 Subject: [PATCH] Debugger: Correct merging fragmented blocks. Oops, wasn't clearing them so was eventually maxing out fragmentation. --- Core/Debugger/MemBlockInfo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/Debugger/MemBlockInfo.cpp b/Core/Debugger/MemBlockInfo.cpp index 68cbcefe35..8ce39e0f9e 100644 --- a/Core/Debugger/MemBlockInfo.cpp +++ b/Core/Debugger/MemBlockInfo.cpp @@ -110,7 +110,7 @@ bool MemSlabMap::Mark(uint32_t addr, uint32_t size, uint64_t ticks, uint32_t pc, slab->tag = tag; // Move on to the next one. - if (firstMatch != nullptr) + if (firstMatch == nullptr) firstMatch = slab; slab = slab->next; } @@ -296,6 +296,11 @@ void MemSlabMap::Merge(Slab *a, Slab *b) { } // Take over index entries b had. FillHeads(a); + if (b->ticks > a->ticks) { + a->ticks = b->ticks; + // In case we ignore PC for same. + a->pc = b->pc; + } if (lastFind_ == b) lastFind_ = a; delete b;