A question about moving GC

Stewart Gordon smjg_1998 at yahoo.com
Wed Jun 7 04:54:01 PDT 2006


Walter Bright wrote:
> Max Samuha wrote:
>> Thank you for the extensive explanation!
>> Marking my code with '// !!! Passing a pointer to C.' is what i've
>> been doing recently:) and it seems the best solution for now until
>> ares is mature or phobos has pin/unpin, or pointers passed to C are
>> pinned implicitly.
> 
> They will be pinned implicitly, no need to call pin/unpin. The only time 
> you're going to have a problem is if the C routine hides the pointer in 
> a malloc'd buffer where the gc won't see it. The gc *will* see pointers 
> on the C stack.

Would it remain pinned indefinitely, until the C function exits, or 
until the program explicitly unpins it by some means?

Stewart.



More information about the Digitalmars-d-learn mailing list