A question about moving GC
Stewart Gordon
smjg_1998 at yahoo.com
Thu Jun 8 07:56:39 PDT 2006
Walter Bright wrote:
> Stewart Gordon wrote:
<snip>
>> Would it remain pinned indefinitely, until the C function exits, or
>> until the program explicitly unpins it by some means?
>
> It's pinned because it's on the stack, just like pointers on the stack
> for your D functions. The gc doesn't know the difference.
But what if the foreign code needs to hold onto the pointer for longer
than it can remain on the stack?
Stewart.
More information about the Digitalmars-d-learn
mailing list