[MLton] an analysis to flatten refs into tuples

Matthew Fluet fluet@cs.cornell.edu
Sun, 16 May 2004 11:44:01 -0400 (EDT)


> > This local analysis reminds me a lot of the local ref analysis.  And, I
> > think you need to be concerned with the same problems of escaping refs.
> > Remember, in the multi-threaded case, a ref can also escape to the stack
> > across a non-tail call.
>
> True, a ref can escape to the stack, but I don't see how that
> invalidates flattening it into the tuple, because flattening will then
> cause the tuple to escape into the stack.  The difference from
> local-ref seems to be that the mutability is not being changed, we're
> simply changing the data structure where the mutability is.

Agreed.