[Dlang-internal] DIP1000 discussion and testing

Martin Nowak via Dlang-internal dlang-internal at puremagic.com
Wed Oct 19 10:48:21 PDT 2016


On Sunday, 16 October 2016 at 13:45:42 UTC, Dicebot wrote:
> So, there is a pull request 
> (https://github.com/dlang/dmd/pull/5972)
> which is intended to implement DIP1000
> (https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md).

Can we first get a high level overview about existing discussions 
and the goals/problems of DIP1000.
Not sure this forum is the right place for detailed DIP/PR 
reviews.

The DIP is named Scoped Pointers, but seems to address any 
escaping references (including classes).
Will it fully enable @safe reference counted memory management?
What pieces of the puzzle are still missing?
How much of DIP1000 does #5972 implement?

I read that RC `opAssign` and `destroy` would remain unsafe b/c 
destroying the owner might leave a dangling ref parameter in 
`fun(ref RCS rc, ref int ri)`.
It seems that unsafe assignment/destruction of RCs would be very 
limiting.
Do we at least have an idea how to tackle this problem? In the 
RCClass idea an additional addRef/decRef call was proposed.
Also see 
https://github.com/dlang/DIPs/pull/35#issuecomment-252345548.



More information about the Dlang-internal mailing list