Bug 15509 – IAllocator must be exposed via a reference counted struct

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-03T22:43:51Z
Last change time
2018-02-02T18:20:44Z
Assigned to
No Owner
Creator
Andrei Alexandrescu
Depends on
13972, 13983, 14168

Comments

Comment #0 by andrei — 2016-01-03T22:43:51Z
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.
Comment #1 by public — 2016-01-03T23:09:49Z
Is http://dlang.org/library/std/typecons/ref_counted.html considered up to the quality for this?
Comment #2 by andrei — 2016-01-03T23:22:27Z
(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.
Comment #5 by greensunny12 — 2018-02-02T18:20:44Z