toStringz note about keeping references

Jacob Carlborg doob at me.com
Mon Oct 15 00:57:09 PDT 2012


On 2012-10-15 01:56, Jonathan M Davis wrote:

> However, I believe that another option is to explicitly tell  the GC not
> collect a chunk of memory (glancing at core.memory, I suspect that removeRoot
> is the function to use for that, but I've never done it before, so I'm not
> well acquainted with the details).

It's the other way around. The GC will collect anything not reachable 
from the roots. The correct way is to use "addRoot".

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list