plum

#treesitter#compiler#wasm

git clone https://git.pyrossh.dev/plum

A statically typed, imperative programming language inspired by rust, python


f2156fc — Peter John 2026-11-03T20:24:50+05:30
hosts: start the wasmtime GC heap at 64 MiB
plum-cli/src/main.rs CHANGED
@@ -798,6 +798,9 @@ fn cmdRun(file: std::path::PathBuf, lib_path: std::path::PathBuf) -> Result<()>
798
798
  config.wasm_function_references(true);
799
799
  config.wasm_tail_call(true);
800
800
  config.max_wasm_stack(4 << 20);
801
+ // Start the GC heap at 64 MiB (reserved, committed lazily) so list-heavy programs
802
+ // skip the early full-heap copies of each doubling growth (docs/plans/2026-11-03-gc-report.md).
803
+ config.gc_heap_initial_size(64 << 20);
801
804
  config.async_stack_size(8 << 20);
802
805
  let engine = wasmtime::Engine::new(&config)
803
806
  .map_err(|e| anyhow::anyhow!("failed to construct wasmtime engine: {e}"))?;
@@ -951,6 +954,9 @@ fn runTestFile(file: &std::path::Path, lib_path: &std::path::Path) -> Result<(us
951
954
  config.wasm_function_references(true);
952
955
  config.wasm_tail_call(true);
953
956
  config.max_wasm_stack(4 << 20);
957
+ // Start the GC heap at 64 MiB (reserved, committed lazily) so list-heavy programs
958
+ // skip the early full-heap copies of each doubling growth (docs/plans/2026-11-03-gc-report.md).
959
+ config.gc_heap_initial_size(64 << 20);
954
960
  config.async_stack_size(8 << 20);
955
961
  let engine = wasmtime::Engine::new(&config)
956
962
  .map_err(|e| anyhow::anyhow!("failed to construct wasmtime engine: {e}"))?;
plum-game/src/host.rs CHANGED
@@ -164,6 +164,9 @@ impl<B: Backend> PlumGame<B> {
164
164
  config.wasm_function_references(true);
165
165
  config.wasm_tail_call(true);
166
166
  config.max_wasm_stack(4 << 20);
167
+ // Start the GC heap at 64 MiB (reserved, committed lazily) so list-heavy programs
168
+ // skip the early full-heap copies of each doubling growth (docs/plans/2026-11-03-gc-report.md).
169
+ config.gc_heap_initial_size(64 << 20);
167
170
  config.async_stack_size(8 << 20);
168
171
  let engine = Engine::new(&config)?;
169
172
  let module = Module::new(&engine, wasm)?;
plum-runtime/src/main.rs CHANGED
@@ -363,6 +363,9 @@ fn main() {
363
363
  config.wasm_function_references(true);
364
364
  config.wasm_tail_call(true);
365
365
  config.max_wasm_stack(4 << 20);
366
+ // Start the GC heap at 64 MiB (reserved, committed lazily) so list-heavy programs
367
+ // skip the early full-heap copies of each doubling growth (docs/plans/2026-11-03-gc-report.md).
368
+ config.gc_heap_initial_size(64 << 20);
366
369
  config.async_stack_size(8 << 20);
367
370
  let engine = wasmtime::Engine::new(&config).expect("engine with GC config should construct");
368
371