[Dlang-study] [lifetime] Initial thoughts on lifetime management

Andrei Alexandrescu andrei at erdani.com
Wed Oct 28 15:28:32 PDT 2015


On 10/28/2015 04:01 PM, Walter Bright wrote:
> Another option is, when doing an assignment to an rc handle, and the ref
> count goes to zero, to not delete the rc object, but to hand it to the
> garbage collector to eventually reap.

Two matters:

1. Planning to let objects leak seems like a cop-out if we find 
ourselves in front of an insoluble problem. So it's at best an escape 
trap, but I'd very much suggest we don't rely on it throughout this 
discussion.

2. This won't work with non-GC allocators - it'll just leak.


Andrei


More information about the Dlang-study mailing list