Andrei Alexandrescu wrote:

> http://wiki.dlang.org/DIP74 got to reviewable form. Please destroy and
> discuss.
> 
> Thanks,
> 
> Andrei

Trivial typos:

struct, class, and closure types that have RCO members accommodate calls to 
Release during their destruction. 
s/Release/opRelease/

Explicit casting to of from void* does not entail a call to opAddRef.
s/of/or/

also: s/opReleasecalls/opRelease calls/

The examples in "Defining a reference counted object with deallocation", 
and "defining a type that owns resources" both define '_refs', and 
manipulate 'refs'.


This is probably a really stupid question, but how does the 'new' work for 
an RCO. I assume it uses the GC memory allocation system, but must mark it 
as 'not for collection' (or similar), for the GC.free() call to work (as 
used in the examples).

Probably another silly question: How would the examples work with 
const/immutable (using examples in howtos)?
e.g. const Widget a = new Widget;
     auto b = a;        <-- mutable method Widget.opAddRef is not callable 
using a const object


Reply via email to