Summary
The WASM compilation target uses a bump allocator only. Linear memory is never reclaimed.
Current state
- String constants and closures are allocated in linear memory
- A simple bump allocator (
heap_offset) advances monotonically
- No garbage collection or memory reclamation of any kind
- Programs that allocate heavily will eventually run out of memory
What's needed
- A garbage collection strategy suitable for WASM linear memory
- Reference counting or tracing GC for heap-allocated values
- Integration with the
Alloc effect tracking (spec Chapter 7, Section 7.7.4)
Spec reference
Chapter 11, Section 11.12 "Limitations"
Summary
The WASM compilation target uses a bump allocator only. Linear memory is never reclaimed.
Current state
heap_offset) advances monotonicallyWhat's needed
Alloceffect tracking (spec Chapter 7, Section 7.7.4)Spec reference
Chapter 11, Section 11.12 "Limitations"