Allocator-aware @safe reference counting is still not possible
Paul Backus
snarwin at gmail.com
Mon Jan 23 19:04:44 UTC 2023
On Monday, 23 January 2023 at 17:49:20 UTC, Richard (Rikki)
Andrew Cattermole wrote:
> A lot of it is already done with DIP1000.
>
> When you call a function and pass a borrowed value in, that
> part is complete.
>
> What we are missing is the initial borrow action and
> guaranteeing it being tied to another object in terms of life.
>
> This only really needs to cover within a function body, so the
> DFA here should actually be really easy.
>
> Perhaps something like this (note ref not actually required for
> pointer types):
>
> [...]
I agree that this would work, but I'm not convinced it can be
done as an incremental change on top of the existing `scope`
system--I think we would end up having to essentially redesign
and reimplement `scope` from scratch by the time we were done.
Then again, it's not obvious that implementing `isolated` would
be *less* work than reimplementing `scope` from scratch, so maybe
it's just as good a proposal. :)
More information about the Digitalmars-d
mailing list