From 08575a8b5e3d466f3b7793391f50cb2ce4f1fbc6 Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Thu, 8 Jul 2021 11:05:00 -0700 Subject: [PATCH] Add setter for enabling multi-memory to the C API. This commit adds `wasmtime_config_wasm_multi_memory_set` to the C API. Fixes #3066. --- crates/c-api/include/wasmtime/config.h | 8 ++++++++ crates/c-api/src/config.rs | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/crates/c-api/include/wasmtime/config.h b/crates/c-api/include/wasmtime/config.h index 6c9e051f9a..356764e42a 100644 --- a/crates/c-api/include/wasmtime/config.h +++ b/crates/c-api/include/wasmtime/config.h @@ -176,6 +176,14 @@ WASMTIME_CONFIG_PROP(void, wasm_bulk_memory, bool) */ WASMTIME_CONFIG_PROP(void, wasm_multi_value, bool) +/** + * \brief Configures whether the WebAssembly multi-memory proposal is + * enabled. + * + * This setting is `false` by default. + */ +WASMTIME_CONFIG_PROP(void, wasm_multi_memory, bool) + /** * \brief Configures whether the WebAssembly module linking proposal is * enabled. diff --git a/crates/c-api/src/config.rs b/crates/c-api/src/config.rs index 3e6e313ba9..40def6148f 100644 --- a/crates/c-api/src/config.rs +++ b/crates/c-api/src/config.rs @@ -90,6 +90,11 @@ pub extern "C" fn wasmtime_config_wasm_multi_value_set(c: &mut wasm_config_t, en c.config.wasm_multi_value(enable); } +#[no_mangle] +pub extern "C" fn wasmtime_config_wasm_multi_memory_set(c: &mut wasm_config_t, enable: bool) { + c.config.wasm_multi_memory(enable); +} + #[no_mangle] pub extern "C" fn wasmtime_config_wasm_module_linking_set(c: &mut wasm_config_t, enable: bool) { c.config.wasm_module_linking(enable);