Allocator-aware @safe reference counting is still not possible

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Mon Jan 30 18:33:57 UTC 2023


On 31/01/2023 7:19 AM, Paul Backus wrote:
>> So no I don't think we can have 1/2 without hiring some people, but we 
>> can get close enough to it with what resources we do have, just by 
>> telling people to not use something and push them instead to use 
>> things that do offer it as long you don't do something outright stupid 
>> (which lets face it, they probably won't be using anything other than 
>> the default global allocator).
> 
> I am afraid that this description is far too vague for me to understand 
> what you have in mind here. Are you advocating for (1)+(3), (2)+(3), or 
> maybe some hybrid of both? Like, if you use one of the Officially 
> Blessed allocators, the container will be @safe, and if you use a 
> 3rd-party custom allocator, it'll be @system?

If we hired some people then yes 1&2 (but not 3). Otherwise we are stuck 
with changing the goal posts from perfect to good enough for the time 
being. As Andrei use to say: perfect is the enemy of the good; which is 
unfortunately what I think we need to strongly consider here. We have 
what appears to be a pretty decent path forward for 'good'.

It shouldn't matter what allocator library you use. Either it works or 
it doesn't. The compiler shouldn't care whose code it is, only the 
lifetime patterns.


More information about the Digitalmars-d mailing list