https://issues.dlang.org/show_bug.cgi?id=15809
--- Comment #2 from [email protected] --- It boils down to this: ---- alias T = void*; struct RefCounted { T* _store; this(int dummy) { import core.memory : GC; import core.stdc.stdlib : malloc; _store = cast(T*)malloc(T.sizeof); GC.addRange(&_store, T.sizeof); } ~this() { assert(_store !is null); import core.memory : GC; GC.removeRange(&_store); } } void main() { auto a = new RefCounted(0); } ---- I don't know if there's anything wrong with this usage of GC.addRange/GC.removeRange. If there is, this is a bug in std.typecons.RefCounted. If there's not, it's a druntime/dmd issue. --
