Skip to content

Memory and regions

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
Terminal window
vow explain tests/lang/arena_local.vow
  • Not a garbage collector
  • Not manual malloc/free
  • Analysis is intraprocedural and conservative — see Limitations

Measured cold start / size: /BENCHMARKS.md.