- Notifications
You must be signed in to change notification settings - Fork8
Commit264c767
zach
fix: require modules to have exported, bounded memory when manifest
- Requires modules compiled to run with manifests that set `max_memory`to have an exported memory with lower and upper bounds- Includes the size of memory exported from modules when calculatingavailable memory for plugins## How to compile a module with bounded memory You will need to pass `--max-memory=$NUM_BYTES` to wasm-ld. `$NUM_BYTES`must be a multiple of the page size. Here are some examples forsupported PDK languages:**C** Pass `-Wl,--max-memory=65536` to your C compiler**Rust**: In a `.cargo/config` file:```toml[target.wasm32-unknown-unknown]rustflags = ["-Clink-args=--max-memory=65536"] ```**Haskell**Add the following to the cabal file entry for your `cabal.project` file:```package myproject ghc-options: -optl -Wl,--max-memory=65536```**AssemblyScript**Pass `--maximumMemory 65536` to the assemblyscropt compiler**TinyGo**:Create a `target.json` file:```json{ "inherits": [ "wasm" ], "ldflags": [ "--max-memory=65536", ]}```and build using `tinygo -target ./target.json`memory.max_pages field is set (#356)1 parent26802e9 commit264c767
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | | - | |
26 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments
Comments
(0)