-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(swingset): add refcounts, implement decref processing
This adds a new DB key for each kernel object, which contains a comma-separated pair of (reachable, recognizable) reference counts. The vatKeeper functions that add/remove clist entries now update these counts: * the 'reachable' count is incremented whenever the reachable flag in the clist entry is changed from false to true, and decremented in the other direction * increment/decrementRefCount take options to indicate whether the kref is being uses as an import, or an export (since exports don't count towards object refcounts), and whether both reachable+recognizable counts are being changed or merely the recognizable count * deleteCListEntry takes a flag to disable decref, which will be used when deleting an object export (since the refcounts will be zero by that point) `deadKernelPromises` and `purgeDeadKernelPromises` were generalized into `maybeFreeKrefs` and `processRefcounts()`. A few other cleanups/improvements were made: * `kernel.dump()` adds `.objects` with refcounts * `kernelObjectExists()` was added as a stable way to ask the question refs #3109
- Loading branch information
Showing
5 changed files
with
258 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.