Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit264c767

Browse files
author
zach
authored
fix: require modules to have exported, bounded memory when manifestmemory.max_pages field is set (#356)
- 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`
1 parent26802e9 commit264c767

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎java/src/test/java/org/extism/sdk/PluginTests.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public class PluginTests {
2020

2121
@Test
2222
publicvoidshouldInvokeFunctionWithMemoryOptions() {
23-
//FIXME check whether memory options are effective
2423
varmanifest =newManifest(List.of(CODE.pathWasmSource()),newMemoryOptions(0));
25-
varoutput =Extism.invokeFunction(manifest,"count_vowels","Hello World");
26-
assertThat(output).isEqualTo("{\"count\": 3}");
24+
assertThrows(ExtismException.class, () -> {
25+
Extism.invokeFunction(manifest,"count_vowels","Hello World");
26+
});
2727
}
2828

2929
@Test

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp