RFC: scope and borrowing

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 27 23:52:30 PDT 2014


On 24/08/14 15:14, "Marc Schütz" <schuetzm at gmx.net>" wrote:
> In the "Opportunities for D" thread, Walter again mentioned the topics
> ref counting, GC, uniqueness, and borrowing, from which a lively
> discussion developed [1]. I took this thread as an opportunity to write
> down some ideas about these topics. The result is a rather extensive
> proposal for the implementation of borrowing, and its implementations:
>
> http://wiki.dlang.org/User:Schuetzm/scope

I assume with this proposal it should be safe to do more stack 
allocations and have the compiler verify references don't escape the 
scope. Would there be a good idea to and a new function, besides the 
destructor, that will be called for variables declared as "scope" when 
they go out of scope.

The problem with destructors are that they can be called both when an 
object is deleted by the GC and when an object goes of out scope.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list