std.variant, elaborate copying and GC

Rene Zwanenburg renezwanenburg at gmail.com
Tue Apr 8 09:32:52 PDT 2014


On Tuesday, 8 April 2014 at 16:03:01 UTC, Yuriy wrote:
> Also, i can't completely understand how garbage collection 
> works. E.g. setting an instance of a class to std.variant will 
> copy its reference to variant's internal storage, which is 
> void[]. Will GC loose track of such reference? Thanx.

It won't. There has been some work on a precise GC but I don't 
know how much is being used at the moment. In any case, for 
untyped memory the GC will assume the worst and treat every word 
as a potential pointer.


More information about the Digitalmars-d-learn mailing list