Closed
Description
This is an idea to improve the safety of Swift objects created from java.
Something like:
try (var arena = SwiftArena.ofConfined()) {
var obj = new MySwiftObject(arena)
hello(obj)
} // count down obj, assert that destroyed
// if obj refcount > 1, it was "leaked"
// beyond lifetime of the arena which is a programming error
We can have the arena perform the actual allocation or still leave it to the underlying init, how we should look at the refcounts and make sure we don't "leak" such managed object.