Skip to content
Snippets Groups Projects
Commit e90eee97 authored by pompolic's avatar pompolic
Browse files

Remove additional variable, edit comment

parent 125507a4
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,6 @@ class ParserStack: ...@@ -91,7 +91,6 @@ class ParserStack:
self.top_level_parse = top_level_parse # To avoid depending on top_level_parse.py self.top_level_parse = top_level_parse # To avoid depending on top_level_parse.py
self.p_stack = [] self.p_stack = []
self.unclaimed_mem_use = 0 self.unclaimed_mem_use = 0
self.partial_alloc_counts = []
self.stack_events = [] self.stack_events = []
# Represents the index of a "waterline" on the stack_events for the purpose of counting allocations # 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. # 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: ...@@ -130,7 +129,6 @@ class ParserStack:
def push(self, parser, should_commit=False): def push(self, parser, should_commit=False):
self.p_stack.append(parser) self.p_stack.append(parser)
self.partial_alloc_counts.append(None)
if self.top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: 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 #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)) self.stack_events.append((StackEvent.PUSH, int(self.arena_gdbval['arena_malloc_bytes']), parser))
...@@ -149,7 +147,6 @@ class ParserStack: ...@@ -149,7 +147,6 @@ class ParserStack:
self.commit_at_push() self.commit_at_push()
def pop(self): def pop(self):
self.partial_alloc_counts.pop()
parser_obj = self.peek() parser_obj = self.peek()
if self.top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS: if self.top_level_parse.memory_stat_method == HammerMemoryStatisticsMethod.DETAILED_ARENA_STATS:
...@@ -221,10 +218,7 @@ class ParserStack: ...@@ -221,10 +218,7 @@ class ParserStack:
# Represented by a '(' for push, and ')' pop, a typical list of stack events might look like: # Represented by a '(' for push, and ')' pop, a typical list of stack events might look like:
# (()(())((()((((()((((( # (()(())((()((((()(((((
# This can be broken up to the following: # 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:
# 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:
# (()(())((()((((() | ((((( # (()(())((()((((() | (((((
# (()(())((()(((( | () | ((((( # (()(())((()(((( | () | (((((
# (()(())((() | (((( | () | ((((( # (()(())((() | (((( | () | (((((
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment