d future or plans for d3
bearophile
bearophileHUGS at lycos.com
Sun Dec 18 15:24:11 PST 2011
Vladimir Panteleev:
> Also, D can't have a completely precise GC as long as it has unions
Despite C/D unions are untagged, in many cases there is some kind of manually managed tag (maybe stored elsewhere), or the programmer often knows (despite being sometimes wrong) what type is present inside the union at a given time. So I have suggested a standard optional method for D unions, named onGC, that is called by the GC and informs the GC what type is present inside the union. So if you keep a union that is able to contain a size_t and a pointer, the onGC is able to tell the GC if in a given moment the union contains a pointer to follow in its search for alive objects, or an integral number to ignore.
Bye,
bearophile
More information about the Digitalmars-d
mailing list