Allocator-aware @safe reference counting is still not possible

Paul Backus snarwin at gmail.com
Mon Jan 30 17:36:59 UTC 2023


On Monday, 30 January 2023 at 17:22:56 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> Unfortunately I have indeed completely grasped it.
>
> I genuinely do not believe it will have the ROI that others 
> seem to think it will.
>
> Walter has shown that he does not want the DFA that I strongly 
> suspect is required to do this properly and therefore trying to 
> solve this will only result in wasted effort when we could get 
> almost there without it within our (ok sometimes artificial) 
> limitations.

As far as I am aware, it is impossible to have all three of the 
following:

1. @safe containers.
2. User-supplied allocators.
3. No language changes.

Given Walter and Atila's stance on memory safety, (1) is 
non-negotiable, so the question is whether we prefer (1)+(2) 
(implement isolated or something similar) or (1)+(3) (do not 
allow users to define their own allocators). I myself am not sure 
which of these would have better ROI.

In this post, it sounds as though you are advocating for (1)+(3). 
But in your previous post [1], you replied to my claim that 
(1)+(2) requires not-(3) with "No? The data structure is the one 
doing the lifetime management," which suggested to me that you 
believe (1)+(2)+(3) is actually possible somehow.

If you agree with me that (1)+(2)+(3) is impossible, then I have 
no objections to your other claims. If you believe that 
(1)+(2)+(3) is possible, on the other hand, then I would very 
much like to hear how.

[1] https://forum.dlang.org/post/tr8t5i$2gt5$1@digitalmars.com


More information about the Digitalmars-d mailing list