On Tue, Jul 30, 2013 at 3:28 PM, Jonathan S. Shapiro <[email protected]>wrote:

> Consider strpos(), where you want to return an interior pointer to a
> C-style string. A region system lets you say that the liveness of the
> returned pointer has to match the liveness of the argument. Absent that, a
> memory-safe language is required to allocate a new string.
>

I'll have to read up on regions-research to understand why the term region
is used here. To me region conjures the concepts of allocating a bunch of
stuff into a segregated heap, as in region-allocators. The concept above
does not seem at all related to that issue for generalized GC regions. I
like Rust's choice to call this specific concept "lifetimes", since it is
orthogonal to segregated-heap-regions and can be done without them.

IMO, we want the borrowed return value this to work for collections to. In
order to do that, we need to also return an out-pointer to the box back to
the caller. I posted about this notion of using Rust's lifetime concept to
allow return of borrowed ref pointers in CLR.

http://www.coyotos.org/pipermail/bitc-dev/2013-July/003770.html
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to