Allocator-aware @safe reference counting is still not possible

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Mon Jan 30 17:22:56 UTC 2023


On 31/01/2023 6:18 AM, Paul Backus wrote:
> It seems as though you have completely failed to grasp the essential 
> point of my original post [1].
> 
> In order for a data structure to provide these guarantees to its users, 
> the allocator must, in turn, provide certain guarantees *to the data 
> structure*. And if the data structure does not know in advance which 
> allocator it will be using (e.g., if it is calling a generic 
> RCAllocator.deallocate function), then those guarantees must be *encoded 
> in the type system* somehow, so that @safe code cannot accidentally 
> break them.

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.


More information about the Digitalmars-d mailing list