Don Wrote: > Tomek SowiƱski wrote: > > I'm far from being a GC expert but I think Java having identified such > > cases with escape analysis just puts locally allocated objects on the stack. > > That works for the non-leaky function itself, but it doesn't help for > the functions it calls.
It'd reduce the use of the pure heap to leaky pure functions called from pure functions. If I understood the original proposal correctly, this would reduce how frequently pure functions have to manipulate the pure stack. I haven't thought through the exception handling case, so I may be completely wrong! I was originally assuming the return type of a pure function was enough to determine if it wasn't leaky, but now I'm thinking only pure nothrow functions can be non-leaky. That might make the stack allocation optimization too rare to be worthwhile?
