See doc comments in: moonbuild_rupes_recta::build_lower::compiler.
The command adapter captures MOON_WASM_NEW_ALLOCATOR=1 in BackendConfig::Wasm.
See Wasm build configuration for usage. Lowering
passes -allocator tlsf-mbt to every moonc link-core action for that backend,
including library, executable, test, and benchmark links, for both Wasm binary
and WAT output, and to moonc wasm-ld under
separate compilation. Other compiler phases and target backends are unaffected.
When the variable is unset or has a value other than 1, Moon omits the flag.
MOON_COLLECT_REF_CYCLE=1 adds -enable-trial-deletion to moonc link-core
for the linear-memory Wasm backend (--target wasm), including WAT output,
and to moonc wasm-ld under separate compilation.
The setting applies to project and standalone executable builds, runs, tests,
and benchmarks. It does not add flags to package compilation or checking.
WasmGC and JavaScript keep their existing garbage collection behavior.
Native C compilation uses the corresponding runtime macro described in
Native C toolchain resolution.
The variable is disabled when unset or set to any value other than 1.
The selected flags are part of execution commands, so toggling the setting
invalidates affected incremental builds and cached actions.
The command adapter captures MOON_SEPARATE_COMPILATION=1 in
BackendConfig::Wasm; any other value or an unset variable disables it. For
the executables that planning links from objects (see
the package build process):
- the main object is a
link-coreof the executable's target with a.ooutput and without-wasm-module-name; - each library object is a
link-coreof its package with-pkg-type library, a.ooutput, and no-pkg-config-path, exports or module link flags; moonc wasm-ld <objects> -o <executable>links them, with-gwhenlink-coregets it, and the-wasi,-allocator tlsf-mbtand-enable-trial-deletionsettings of the objects.