Allocator-aware @safe reference counting is still not possible

Paul Backus snarwin at gmail.com
Mon Jan 23 16:41:07 UTC 2023


On Monday, 23 January 2023 at 16:39:07 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> Yes, a bad allocator is still a bad allocator. There is nothing 
> we can do to guard against that. Only something like address 
> sanitizer could prevent bad things from happening.
>
> Unfortunately there is also nothing stopping the implementation 
> in phobos or libc from doing the same thing either. Its not 
> really worth considering at this level. Either by mistake or on 
> purpose a memory allocator can corrupt memory without the D 
> compiler being able to discover it, @safe has nothing to do 
> with it.

Please read the original thread linked in Atila's first post. It 
is not very long, and I responded to these exact objections in 
that thread already.


More information about the Digitalmars-d mailing list