On Friday, 9 February 2018 at 01:36:02 UTC, Mike Franklin wrote:
On Friday, 9 February 2018 at 01:31:41 UTC, Mike Franklin wrote:
On Thursday, 8 February 2018 at 17:10:00 UTC, bachmeier wrote:
What are D's limitations on do-it-yourself reference counting?
* Types that are built into the language like dynamic arrays,
associative arrays, and exceptions won't benefit from DIY
* Much of Phobos probably wouldn't be compatible with DIY
That being said, there may be a way to override some runtime
hooks like _d_newclass
etc... to make it work. But I haven't tried.
Also, I think Walter is currently working on getting reference
counted exceptions into the language:
Also, I think DIY reference counting is already done for us in
the automem library
We use std.typecons.RefCounted in many places in Phobos too.
There is only one big problem at the moment: it's not @safe and
can only be @safe with DIP1000.
This is actually blocking a lot of work - think RCString,
containers or even just a simple range which needs heap memory as