From 119653519cae8eb98ced851cf81fbe00fc161f30 Mon Sep 17 00:00:00 2001
From: pompolic <pompolic@special-circumstanc.es>
Date: Sat, 13 May 2023 20:50:33 +0200
Subject: [PATCH] (WIP) Update self.pending_allocs directly

---
 gdb-port/top-level-parse.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gdb-port/top-level-parse.py b/gdb-port/top-level-parse.py
index aa20216..da6a1e0 100644
--- a/gdb-port/top-level-parse.py
+++ b/gdb-port/top-level-parse.py
@@ -268,15 +268,14 @@ class TopLevelParse:
 	# TODO: get_avg_mem_use_all_arenas, get_total_mem_use
 
 	def gather_allocations_in_parser_stacks(self):
-		pending_allocs_by_arena = {}
-
 		for ps in self.parser_stacks:
 			new_allocs_by_arena = ps.get_pending_allocations()
 			new_allocs = new_allocs_by_arena.get(ps.arena_int, {})
 			pending_allocs = self.pending_allocs.get(ps.arena_int, {})
 			for addr, alloc in new_allocs:
 				pending_allocs[addr] = pending_allocs.get(addr, 0) + alloc
-			pending_allocs_by_arena[ps.arena_int] = pending_allocs
+			self.pending_allocs[ps.arena_int] = pending_allocs
+
 
 		# TODO: allocations are grouped by arena, then parser address. we get the arena address from the parser stack, which may be shared between parser stacks
 		# Therefore, it can't just be blindly assigned to a key with the arena's address. the two dicts need to be merged, with the values of duplicate entries added together
-- 
GitLab