On Sun, Sep 25, 2016 at 7:14 AM, Eliot Miranda <
[hidden email]> wrote:
> Hi Ben,
>
>> On Sep 23, 2016, at 8:17 PM, Ben Coman <
[hidden email]> wrote:
>>
>> How does object pinning interact with garbage collection? Does it
>> block garbage collection until it is manually unpinned? Or does it
>> garbage collection proceed anyway? Intuitively I'd guess the former??
>
> The latter. The properties are orthogonal. Unreachable pinned objects are still unreachable. Therefore they are garbage collected. A use case that wishes to maintain a pinned object over some time period must arrange that there is a string reference to the object to define that time span.
Thanks Eliot. So we need to be careful/aware of the corner case where
an FFI callout function may store a reference to a pinned object past
the return from the callout, and arrange things as you say.
cheers -ben