Skip to content

Commit

Permalink
Further improved stageDelimiter memory management
Browse files Browse the repository at this point in the history
  • Loading branch information
REllEK-IO committed Oct 12, 2023
1 parent 547ea6b commit 77a89e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@phuire/strx",
"version": "0.0.28",
"version": "0.0.29",
"description": "Unified Turing Machine",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
6 changes: 6 additions & 0 deletions src/model/stagePlanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ export class UnifiedSubject extends Subject<Concept[]> {
if (options?.setStage) {
plan.stage = options.setStage;
}
if (options?.iterateStage || (options?.setStage && options.setStage !== plan.stage)) {
stageDelimiter.prevActions = [];
stageDelimiter.unionExpiration = [];
stageDelimiter.runOnceMap = new Map();
this.stageDelimiters.set(key, stageDelimiter);
}
// Horrifying
// Keep in place, this prevents branch prediction from creating ghost actions if there is an action overflow.
if (plan.stageFailed === -1) {
Expand Down

0 comments on commit 77a89e0

Please sign in to comment.