Skip to content
File

Blob: src/workerd/io/wasm/signal-memory-reclaim.wat

535 bytes
1;; Large-memory module (16MB) for GC reclamation testing.
2;; Instantiating many of these without reclaiming terminated ones would OOM.
3 
4(module
5 (memory (export "memory") 256)
6 
7 (global (export "__instance_signal") i32 (i32.const 0))
8 (global (export "__instance_terminated") i32 (i32.const 4))
9 
10 ;; Write non-zero to terminated address, signaling the module has exited.
11 (func (export "mark_exited")
12 (i32.store (global.get 1) (i32.const 1))
13 )
14 
15 (func (export "get_signal") (result i32)
16 (i32.load (global.get 1))
17 )
18)