On Fri, Aug 2, 2013 at 10:55 AM, Jonathan S. Shapiro <[email protected]>wrote:

> Because it never escapes, that temporary could be stack allocated. Region
> analysis can easily detect this, and allocating the temporary in that way
> reduces GC pressure.
>

I'm looking for examples where regions help but CLR-like stack-based
value-types don't.

In CLR this carry-case can easily be an out-argument value-type copy to the
caller's stack.

The out-argument solution breaks down if instead of a fixed-size carry,
we're trying to return a variable sized result, especially if that result
needs a graph structure. To me this seems the primary value-area for
Regions... The ability to make some internally consistent and internally
referential set of dynamically allocated objects, which can be handed
around and traversed (via borrowed pointers), but which allows no
non-borrowed pointers.

The thing is, because use of this kind of region might also require GC
inside the region, it's not clear to me that there is a useful general case
solution to this which is obviously better than generational collection.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to