References between arenas ========================= Outer-to-inner: * This does NOT work because: * the inner arena might have a shorter lifetime, and * on exception, the inner arena will be invalidated, but not necessarily the outer arena. Inner-to-outer: * This should work. Related problem: Accessing data from other areans ------------------------------------------------- func arena Thing.do_stuff(ref var Node n) { n.locked = true n.value /= this.divisor # could be 0 n.locked = false } Exceptions are supposed to invalidate/kill all arenas that are reachable from the call chain. In this case, n could be used by an arena that is not a sub-arena of the "this" arena. So the arena of "n" probably need to be invalidated as well. Otherwise, "n" could get stuck in an intermediate state. Solutions: - Disallow passing "ref var" across exception isolation boundaries. Exceptions: "ref var threaded" Related: How to handle exceptions? ---------------------------------- SLUL does not use thread-local state, but uses arenas instead. Solution: - Allow only exceptions in functions that have an arena either as the receiver (for methods) or as the first parameter (for non-methods). - Invalidation of the callee-arena must invalidate all arenas in the current isolation boundary, but should not invalidate any other arenas. => All arenas should have a pointer to the current exception isolation boundary.