D gc on local objects

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 16 10:20:58 PDT 2014


Am 16.04.2014 18:51, schrieb Adam D. Ruppe:
> This is one of the things the `scope` storage class on local variables
> can do, but since it isn't implemented properly, it is not memory safe
> and thus its usage is deprecated.
>
> I really really really want to see scope be fully implemented, including
> not allowing a reference to the variable to escape the scope, but this
> is easier said than done.

Not allowing a variable to escape scope should be easily done with 
dataflow analysis if I recall correctly.

Now, I don't have any idea how easy/simple it is to implement it in the 
existing code base, in a compatible way across all three compilers.

So just speaking out of my soap box.

--
Paulo


More information about the Digitalmars-d mailing list