Garbage collector returning pointers

Robert M. Münch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 15 08:08:43 PDT 2015


On 2015-03-14 20:45:21 +0000, Marc Schütz said:

> As long as the pointer remains on the stack or in a register, the GC 
> will keep the allocation alive.

Hi Marc, ok, got it. Thanks.

>  But if your C code stores the pointer on the C heap or in a global, 
> the GC won't know anything about it and can free it.

Ok. I need to dig into how the interpreter handles the returned pointer 
and how the stack is handled.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list