www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Re: Weak References

 A weak reference library exists but doesn't always work...



If this is the same library that was posted in response to my similar question on the digitalmars.D.learn news group, then you should know that this libarary is mostly likely failing because it casts the reference from the GC's heap to a size_t value, which is clearly stated in the D spec as being "undefined behavior: Do not store pointers into non-pointer variables using casts and other tricks." and "Do not store into pointers values that may point into the garbage collected heap: A copying garbage collector may change this value." I think weak references will require support from the GC API.
Aug 06 2008