Skip to content

Commit

Permalink
Revert "clearing memory stack"
Browse files Browse the repository at this point in the history
This reverts commit c033bed.
  • Loading branch information
saumyaj3 committed Apr 12, 2024
1 parent c033bed commit c76842c
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions UM/Operations/OperationStack.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2019 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
import sys

import threading
import time

Expand Down Expand Up @@ -37,13 +37,6 @@ def _onToolOperationStarted(self, tool):
def _onToolOperationStopped(self, tool):
self._merge_operations = False

def controlStackSize(self):
if sys.getsizeof(self._operations)> 5000:
print("getting stack size", sys.getsizeof(self._operations), len(self._operations))
self._current_index -=1
self._operations.pop(0)
self.controlStackSize()

def push(self, operation):
"""Push an operation on the stack.
Expand Down Expand Up @@ -75,7 +68,7 @@ def push(self, operation):
finally:
self._lock.release()
elapsed_time = time.time() - start_time
self.controlStackSize()

Logger.log("d", " ".join(repr(operation).splitlines()) + ", took {0}ms".format(int(elapsed_time * 1000))) #Don't remove; used in regression-tests.

def undo(self):
Expand Down

0 comments on commit c76842c

Please sign in to comment.