Files
sausage/spikes/s7-preview1-adapter/eager-state.patch
T
surma 5ce2a2f2bd vfs: host-side WASI preview1 over sausage-vfs (T11)
Preview1 state lives in the host, so Go modules (esbuild) work. esbuild bundles
byte-identical to native; uutils and QuickJS-ng file tests pass. The failed
guest-side adapter attempt (T7) moves to spikes/s7-preview1-adapter/.
2026-11-06 16:34:33 +00:00

15 lines
570 B
Diff

diff --git a/crates/wasi-preview1-component-adapter/src/lib.rs b/crates/wasi-preview1-component-adapter/src/lib.rs
index 7ce52c6..55a8480 100644
--- a/crates/wasi-preview1-component-adapter/src/lib.rs
+++ b/crates/wasi-preview1-component-adapter/src/lib.rs
@@ -129,6 +129,9 @@ pub extern "C" fn run() -> u32 {
unsafe extern "C" {
safe fn _start();
}
+ // Reserve adapter state before Go snapshots the linear-memory heap extent.
+ // Lazy memory.grow allocations otherwise overlap Go's sbrk allocator.
+ State::ptr();
_start();
0
}