Allocator-aware @safe reference counting is still not possible

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Mon Jan 23 16:39:07 UTC 2023


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.


More information about the Digitalmars-d mailing list