[D-runtime] [GC] Object collection dependencies

Alex Rønne Petersen xtzgzorex at gmail.com
Sat May 12 03:59:30 PDT 2012


Hi,

Given two objects A and B, I need a way to make it such that A will
always outlive B (i.e. A will never be collected before B is). This
needs to hold regardless of whether A and B have any references to
each other.

I don't think there's any way to do this at present. How hard would it
be to implement this with D's current GC?

I'm asking since this would facilitate a nice, sort-of hack-free
implementation of weak references.

Regards,
Alex


More information about the D-runtime mailing list