Allocator-aware @safe reference counting is still not possible

Paul Backus snarwin at gmail.com
Sun Sep 25 14:23:22 UTC 2022


On Sunday, 25 September 2022 at 14:04:31 UTC, Dukc wrote:
> On Sunday, 25 September 2022 at 13:12:11 UTC, Paul Backus wrote:
>>
>> To make this work, we need the compiler to *enforce* the rules 
>> about what the deallocator can and cannot do.
>
> Why? The deallocator is going to be `@system` anyway.

If you have `isolated`, the deallocator can be made `@safe` by 
having it take an `isolated` pointer as its argument.

You are right that it is not enough just to have the compiler 
enforce the rules on the deallocator--the calling code also has 
to *know* that the rules are being enforced.


More information about the Digitalmars-d mailing list