Skip to content

Commit

Permalink
fix(swingset): only mark refs for processing if refcount hits zero
Browse files Browse the repository at this point in the history
This should remove some unnecessary work done by `processRefcounts` on
objects which have lost one reference, but not all of them.

refs #3106
  • Loading branch information
warner committed Jun 21, 2021
1 parent dcfe169 commit 3354bbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/SwingSet/src/kernel/state/kernelKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,9 @@ export default function makeKernelKeeper(kvStore, streamStore, kernelSlog) {
reachable -= 1;
}
recognizable -= 1;
maybeFreeKrefs.add(kernelSlot);
if (!reachable || !recognizable) {
maybeFreeKrefs.add(kernelSlot);
}
setObjectRefCount(kernelSlot, { reachable, recognizable });
}

Expand Down

0 comments on commit 3354bbf

Please sign in to comment.