DIP69 - Implement scope for escape proof references
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Thu Dec 4 12:32:08 PST 2014
On 12/4/2014 6:58 AM, Steven Schveighoffer wrote:
> This doesn't seem right. For GC data, the GC owns the data, that is true. But
> for Ref-counted data, there is more than one owner, and only when all the owners
> disown the data can it be destroyed.
>
> I think there is a disconnect here, you can't say *nobody* owns the data, and if
> you say one variable owns the data, which one is it?
The owner of the refcounted data is the refcounting wrapper - and the wrapper
decides when to destroy the payload.
(For GC, the "wrapper" is the GC system, which decides to destroy the payload
when there are no longer references to it. Just like a ref counting system.)
More information about the Digitalmars-d
mailing list