Allocator-aware @safe reference counting is still not possible

Paul Backus snarwin at gmail.com
Sun Sep 25 14:52:09 UTC 2022


On Sunday, 25 September 2022 at 14:45:38 UTC, Dukc wrote:
> A language change like that is ideal in the long term. My 
> point, however, is that we're not blocked on waiting for one. 
> An allocator-enabled safe reference counter is possible with 
> the present language (except perhaps for some yet-undiscovered 
> issue). The downside that the deallocators will have to be 
> reviewed against not only causing UB by themselves, but also 
> against leaking a pointer so that it can be reached by `@safe` 
> code.

Well, of course, if you are willing to write unsound `@trusted` 
code, anything can be made `@safe`. :)


More information about the Digitalmars-d mailing list