More radical ideas about gc and reference counting

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Mon May 12 10:25:11 PDT 2014


Walter Bright:

> Unions of pointers are so rare in actual code that treating 
> them conservatively is not a big problem.

std.variant.Algebraic is based on on std.variant.VariantN, and on 
std.variant.VariantN is based on an union, and often you use 
algebraic data types to represent trees and similar data 
structures that contain many references/pointers. Adding Adding 
an onGC() method to std.variant.VariantN you allow the GC to 
manage Algebraic well enough.

Bye,
bearophile


More information about the Digitalmars-d mailing list