Currently any entity may stash away an IAllocator reference without any accounting. This makes it impossible to e.g. detect whether a stack-allocated region goes out of scope with outstanding references to it.
We need to wrap the IAllocator interface in a reference counted struct that offers the same primitives.
(In reply to Dicebot from comment #1)
> Is http://dlang.org/library/std/typecons/ref_counted.html considered up to
> the quality for this?
I think not, for the time being. Ideally user code would have no possibility to get to the actual IAllocator. -- Andrei
Comment #3 by public — 2016-01-03T23:24:10Z
I have expected as much. This makes the issue much more generic (and challenging) :)
Comment #4 by r9shackleford — 2016-01-04T02:25:36Z
(In reply to Andrei Alexandrescu from comment #2)
> (In reply to Dicebot from comment #1)
> > Is http://dlang.org/library/std/typecons/ref_counted.html considered up to
> > the quality for this?
>
> I think not, for the time being. Ideally user code would have no possibility
> to get to the actual IAllocator. -- Andrei
Adding a few dependencies, feel free to remove them if this is not the path being taken.