Allocator-aware @safe reference counting is still not possible

Sebastiaan Koppe mail at skoppe.eu
Sun Sep 25 17:04:51 UTC 2022


On Sunday, 25 September 2022 at 14:23:22 UTC, Paul Backus wrote:
> 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.

That would be nice, but doesn't that tantamount to only being 
able to deallocate something when you can proof there are no 
other aliases? At which point you might as well use that proof 
and have the compiler call deallocate for you ;)


More information about the Digitalmars-d mailing list