; island → frozen → arc keeps one graph: an iref taken from the island reads the same ; object through the arc; a clone and two releases; the last release frees the graph, ; so the same budget fits a new graph. ; expect: run ; grant: heap=mem.alloc:24 ; result: 7 ; phase: 4 ; spec: docs/spec/03-memory-model.md module test.arc_lifecycle air 0 lang 0.1 features [arc, capabilities, effects, heap, islands, ownership, resources] fn @main(%heap: cap) -> u64 effects [mem.alloc] entry: %v = const.u64 7 island.create %v, %heap, ok -> @made, err -> @oom made(%i: island): %g = borrow.ref %i %r = island.root %g borrow.end %g %f = island.freeze %i %a = arc.from_frozen %f %ar = borrow.ref %a %b = arc.clone %ar %x = arc.borrow %ar, %r %w = load %x borrow.end %x borrow.end %ar arc.release %a arc.release %b %one = const.u64 1 arc.new %one, %heap, ok -> @again, err -> @oom2 again(%c: arc): arc.release %c ret %w oom(%e: alloc_error): trap oom2(%e2: alloc_error): trap