-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(swingset): retain more references
This increments the refcount in several cases that would otherwise allow an object to be dropped prematurely: * deviceKeeper: pin objects that pass through the device. Device c-lists lack the "reachable" flag that was recently added to vat c-lists. To prevent devices from losing access to any object that was passed in (temporarily held only by the device, and no vats or run-queue messages), we need to forcibly increment the refcount during device c-list kernel-to-vat translation. This pins those krefs forever. * `kernel.addExport()` is used to pretend that a vat has exported some object, so we can get a kref on it and e.g. submit exomessages with `kernel.queueToKref`. If a real vat had imported this kref, that vat's c-list would maintain a reference to it, keeping the refcount non-zero and inhibiting GC. But if it's merely a unit test that remembers the kref, there is no importing c-list to provide the refcount, and the object is in danger of being collected before the test can finish interacting with it. So this commit changes `kernel.addExport()` to increment the refcount by one, replacing the missing importing vat. * it also increments the refcount on slots of `kpResolution`-retrieved promise resolution data, for the same reason.
- Loading branch information
Showing
4 changed files
with
48 additions
and
23 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
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