Foreign threads in D code.

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 12 05:08:35 PDT 2017


On 2017-07-12 11:28, Biotronic wrote:

> That's basically what I tried to say 

It wasn't very clear to me at least.

> - the GC may collect memory *it has 
> allocated* if the only pointers to it are in memory the GC doesn't scan 
> (i.e. on the stack of an unregistered thread or in memory not allocated 
> via the GC).
> 
> It will not collect memory allocated by other means, but that Foo* you 
> got from D and are using in C++ might point to a Bar soon after the GC 
> runs.

Yes, that can happen.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list