[Vm-dev] Object pinning vs. garbage collection

Marcel Taeumel marcel.taeumel at hpi.de
Wed Apr 27 17:22:51 UTC 2022

Hi Eliot, hi all --

Can a pinned object get garbage collected at all? Do I have to ensure to have at least a single reference to that (pinned) object?

My best answer would be: Yes. Otherwise, I could never get rid of that pinned object again.

This has interesting implications also for an FFI programming interface. If you send out a pointer to object memory everything is fine if (a) that object is pinned an (b) that object does not get garbage collected. Pinning is easy. Keeping track of an object that gets collected but is actually pinned should raise a warning ... I suppose. Hmm...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220427/db4e2298/attachment.html>

More information about the Vm-dev mailing list