Re:A Tour of Safe Tracing GC Designs in Rust
by zozbot234 on Saturday June 19, 2021 @03:35PM
(#27563683)
> should you release an arena too early, you may have introduced a bug.
A memory safe programmming language will detect any such bugs and reject the program. This is not hard, it's a clean application of existing lifetime checks.
And there is of course the question of safety; should you release an arena too early, you may have introduced a bug. Worse: it might not crash immediately.
There is actually some work for doing arena management automatically, called region inference: http://www.mlton.org/Regions
But the way I see it, it's just a way to make memory management even more efficient; it's not about precise release of resources, and indeed not all programs can be expressed so that releases can happen only in batches of an arena (assuming those arenas themselves aren't dynamically managed, which certainly is a valid strategy as well, but manual).