Is there a weak pointer or references in D?
Era Scarecrow
rtcvb32 at yahoo.com
Sat Jan 12 03:27:02 PST 2013
On Saturday, 12 January 2013 at 10:58:23 UTC, thedeemon wrote:
> So the runtime is aware of weak pointers and clears them to
> "empty" state when pointed value dies. I don't see yet how it
> can be implemented in D without patching its GC.
There's that, but also what about what if the pointer wasn't a
pointer to the data at all? What it if was a part of a float that
determined a calculation for your taxes? Or a series of flags
that happen to make that magic number? If they get 'nulled' by
the GC, I'd call that a definite bug and problem; Unless the GC
can tell apart what is and isn't a pointer to data.
More information about the Digitalmars-d-learn
mailing list