The GC (agian)

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Wed Nov 24 09:33:02 UTC 2021


On Wednesday, 24 November 2021 at 09:29:07 UTC, FeepingCreature 
wrote:
> To be fair, it only does that if you explicitly register the 
> non-GC memory with `GC.addRoot`. If you don't do this, GC 
> memory can indeed be freed prematurely while still being 
> referenced from non-GC memory.

Yes, this is the issue. You either have to make the GC scan 
non-GC memory or you have to do lifetimes "in your head". Neither 
are good options for large interactive programs. It can work for 
a tiny game though.




More information about the Digitalmars-d mailing list