A Refcounted Array Type

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 26 10:04:11 PST 2015


On 2/26/15 11:57 AM, Andrei Alexandrescu wrote:
> On 2/26/15 8:51 AM, Steven Schveighoffer wrote:
>> As talked about before, running dtors in the originating thread can
>> solve this problem.
>
> Yah, that will solve the nonatomic reference counting. What do you think
> about http://forum.dlang.org/thread/mcllre$1abs$1@digitalmars.com?

I saw that, it sounds reasonable. I have to mull over what it means.

I think possibly a better solution is to have a "finalize" function, 
similar to how tango does it, so the dtor is only called from 
destroy/delete, and the finalize method is called from the GC.

-Steve



More information about the Digitalmars-d mailing list