ADR-0017: Linear-backend bump/arena allocator; one fixed GC strategy, not a pluggable one

Status: Accepted

Context

The linear-memory backend (src/codegen-linear/, the alternative to the WasmGC backend per ADR-0003 and the codegen-axes split) owns its own allocation — there is no host GC underneath it. We had to decide both which allocation strategy it uses and whether to leave that strategy pluggable.

The field consensus for AOT source→Wasm compilers, captured as recommendation R10 in docs/architecture/compiler-design-lessons.md, is twofold:

  1. Do not build a pluggable / interchangeable GC. Supporting tracing and reference-counting as swappable strategies is documented as not viable — reference counting cannot collect cycles, so a real system bolts tracing on anyway and ends up maintaining both. The GC subsystem is the most-redesigned part of every compiler in this space; over-abstracting it is a known trap.
  2. A bump/arena "allocate-and-never-free" mode is a near-free win for short-lived programs. Most conformance- and CLI-style WASI programs allocate and then exit; for them a tracing collector is pure overhead and code size.

Decision

Consequences