Array of RefCounted objects

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Apr 26 05:01:10 UTC 2019


On Thu, Apr 25, 2019 at 11:21:53AM -0700, H. S. Teoh via Digitalmars-d wrote:
> Has anyone used RefCounted with arrays before?  Do the array element
> dtors get called properly upon GC collection?  Just wondering if I
> should wrap such arrays in a wrapper with more clearly-defined
> lifetime.  I'm aware that RefCounted has its own share of issues, but
> it's the quickest thing to reach for at the moment.
[...]

Actually, nevermind that.  I ended up taking things into my own hands
and rolling my own ref-counting, because RefCounted just behaves oddly
w.r.t. a payload that should not be default-initialized (calls the dtor
too often, leading to double-free bugs).


T

-- 
One reason that few people are aware there are programs running the internet is that they never crash in any significant way: the free software underlying the internet is reliable to the point of invisibility. -- Glyn Moody, from the article "Giving it all away"


More information about the Digitalmars-d mailing list