how to allocate class without gc?

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 28 15:38:52 PST 2016


On Wednesday, 27 January 2016 at 22:39:54 UTC, Igor wrote:
> But doesn't this ultimately defeat the purpose of having manual 
> memory management if one has to add it to the GC to be scanned?

You can make the LOC related to the GC optional with an 
additional bool template parameter and a static if, but as said 
previously it can introduce bugs.

AddRange() is used to make the GC scan pointers inside the range 
(build-in array for example)) but the range is itself well 
manually managed.


More information about the Digitalmars-d-learn mailing list