Data-Flow (Escape) Analysis to Aid in Avoiding GC

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 13 04:58:39 PST 2015


On Friday, 13 February 2015 at 12:50:14 UTC, Tobias Pankrath 
wrote:
> There are no reference counts involved, just simple arithmetic.
>
> string a = "abc";
> string b = a[1 .. $];

Then how does the GC know when to release when there are multiple 
references?

Is this because string references immutable storage?

> Probably -vgc only lists GC allocation inside the current scope 
> and doesn't look inside called functions. For this, there is 
> @nogc.

Isn't vgc recursively inferred bottom-up for calls to templates 
functions?


More information about the Digitalmars-d-learn mailing list