Skip to content

Commit

Permalink
fixup! chore(types): KernelKeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jul 29, 2024
1 parent 5d42863 commit 0dc7d83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/SwingSet/src/kernel/gc-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export function processGCActionSet(kernelKeeper) {
const hasCList = vatKeeper.hasCListEntry(kref);
const isReachable = hasCList ? vatKeeper.getReachableFlag(kref) : undefined;
const exists = kernelKeeper.kernelObjectExists(kref);
// @ts-expect-error FIXME destructuring a boolean
const { reachable, recognizable } = exists
? kernelKeeper.getObjectRefCount(kref)
: {};
Expand Down
5 changes: 4 additions & 1 deletion packages/SwingSet/src/kernel/state/kernelKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const enableKernelGC = true;
// Prefix reserved for host written data:
// host.

/** @type {(s: string) => string[]} s */
export function commaSplit(s) {
if (s === '') {
return [];
Expand Down Expand Up @@ -500,7 +501,9 @@ export default function makeKernelKeeper(kernelStorage, kernelSlog) {

function getObjectRefCount(kernelSlot) {
const data = kvStore.get(`${kernelSlot}.refCount`);
data || Fail`getObjectRefCount(${kernelSlot}) was missing`;
if (!data) {
throw Fail`getObjectRefCount(${kernelSlot}) was missing`;
}
const [reachable, recognizable] = commaSplit(data).map(Number);
reachable <= recognizable ||
Fail`refmismatch(get) ${kernelSlot} ${reachable},${recognizable}`;
Expand Down

0 comments on commit 0dc7d83

Please sign in to comment.