[Proposal] Weak reference implementation for D
Martin Nowak
code at dawg.eu
Thu Oct 17 01:09:23 PDT 2013
On 10/13/2013 09:47 AM, Denis Shelomovskij wrote:
>
> * Alex's one from MCI:
>
> https://github.com/lycus/mci/blob/f9165c287f92e4ef70674828fbadb33ee3967547/src/mci/core/weak.d
>
I remember talking about this with Alex.
He wanted to add some functions to the GC and this is what I came up
with based on the current implementation.
It uses the synchronized GC.addrOf to check whether the loaded pointer
is still valid. Still looks correctly synchronized to me.
https://gist.github.com/dawgfoto/2852438
In fact the load!(msync.acq) could be made load!(msync.raw) too.
More information about the Digitalmars-d
mailing list