summaryrefslogtreecommitdiff
path: root/wasm2c/README.md
diff options
context:
space:
mode:
authorShravan Narayan <shravanrn@gmail.com>2023-04-12 14:02:25 -0400
committerShravan Narayan <shravanrn@gmail.com>2023-04-12 18:38:28 -0400
commiteff5f38e27fde6d3a303c49a1bc5d3548c7f39d6 (patch)
tree49a299d058dbdfd14070a730dcbccfe4e2435e06 /wasm2c/README.md
parentc83f9b02f67adbc20499fc4821941cdf5011dc8a (diff)
downloadwabt-eff5f38e27fde6d3a303c49a1bc5d3548c7f39d6.tar.gz
wabt-eff5f38e27fde6d3a303c49a1bc5d3548c7f39d6.tar.bz2
wabt-eff5f38e27fde6d3a303c49a1bc5d3548c7f39d6.zip
wasm2c: Add optional WASM_RT_GROW_FAILED_HANDLER to be notified of memory growth failures
Diffstat (limited to 'wasm2c/README.md')
-rw-r--r--wasm2c/README.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/wasm2c/README.md b/wasm2c/README.md
index 26dfb368..625ce25b 100644
--- a/wasm2c/README.md
+++ b/wasm2c/README.md
@@ -322,7 +322,13 @@ an i32 or i64 address.
of pages. If there isn't enough memory to do so, or the new page count would be
greater than the maximum page count, the function must fail by returning
`0xffffffff`. If the function succeeds, it must return the previous size of the
-memory instance, in pages.
+memory instance, in pages. The host can optionally be notified of failures by
+defining a function the signature `void wasm2c_grow_failed_handler()` and
+compiling the runtime with the with macro definition `#define
+WASM_RT_GROW_FAILED_HANDLER wasm2c_grow_failed_handler`. It is recommended that
+you add this macro definition via a compiler flag
+(`-WASM_RT_GROW_FAILED_HANDLER=wasm2c_grow_failed_handler` on clang/gcc).
+
`wasm_rt_free_memory` frees the memory instance.