From e90eee97cbeec6bf3f5f25103b35ca1ceb2c3b87 Mon Sep 17 00:00:00 2001 From: pompolic <pompolic@special-circumstanc.es> Date: Tue, 18 Apr 2023 22:33:48 +0200 Subject: [PATCH] Remove additional variable, edit comment --- gdb-port/parser.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gdb-port/parser.py b/gdb-port/parser.py index 7de55d2..7bd7607 100644 --- a/gdb-port/parser.py +++ b/gdb-port/parser.py @@ -91,7 +91,6 @@ class ParserStack: self.top_level_parse = top_level_parse # To avoid depending on top_level_parse.py self.p_stack = [] self.unclaimed_mem_use = 0 - self.partial_alloc_counts = [] self.stack_events = [] # Represents the index of a "waterline" on the stack_events for the purpose of counting allocations # This is the index of the last event (stack push or pop) where the relevant allocations have been committed to TopLevelParse's memory stats. @@ -130,7 +129,6 @@ class ParserStack: def push(self, parser, should_commit=False): self.p_stack.append(parser) - self.partial_alloc_counts.append(None) if self.top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: #TODO: check that self.arena is same as gdb.selected_frame()'s arena self.stack_events.append((StackEvent.PUSH, int(self.arena_gdbval['arena_malloc_bytes']), parser)) @@ -149,7 +147,6 @@ class ParserStack: self.commit_at_push() def pop(self): - self.partial_alloc_counts.pop() parser_obj = self.peek() if self.top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: @@ -221,10 +218,7 @@ class ParserStack: # Represented by a '(' for push, and ')' pop, a typical list of stack events might look like: # (()(())((()((((()((((( - # This can be broken up to the following: - # a string of pushes at the start of the list, that do may not yet have a corresponding "pop" + a push/pop pair enclosing other push/pop pairs or string of pushes + another, optional, string of pushes at the end of the list - - # Processing from end to start (right to left), when encountering a "pop", it is guaranteed there's a push somewhere, so we can break up the list like this: + # Processing from end to start (right to left), when encountering a "pop", it is guaranteed there's a corresponding push somewhere, so we can break up the list like this: # (()(())((()((((() | ((((( # (()(())((()(((( | () | ((((( # (()(())((() | (((( | () | ((((( -- GitLab