Memory and regions
Use case: scratch that dies early
Section titled “Use case: scratch that dies early”fn work() -> int { let keep = "outer" region { let scratch = str_join(["a", "b", "c"], "-") print scratch } print keep return 7}
fn main(caps: Caps) -> int { return work()}- Memory lives in arenas
- The compiler works out when values that never leave a function can die
region { }opens a sub-arena so temporary work can reclaim sooner
vow explain tests/lang/arena_local.vowWhat this is not
Section titled “What this is not”- Not a garbage collector
- Not manual
malloc/free - Analysis is intraprocedural and conservative — see Limitations
Measured cold start / size: /BENCHMARKS.md.