Skip to content

Commit e933c7e

Browse files
authored
Expose Config::static_memory_forced to C (#6413)
* Expose static_memory_forced to C * Update config.h to include static_memory_forced config prop
1 parent 9733e7d commit e933c7e

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

crates/c-api/include/wasmtime/config.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ WASMTIME_CONFIG_PROP(void, cranelift_opt_level, wasmtime_opt_level_t)
265265
*/
266266
WASMTIME_CONFIG_PROP(void, profiler, wasmtime_profiling_strategy_t)
267267

268+
/**
269+
* \brief Configures the “static” style of memory to always be used.
270+
*
271+
* This setting is `false` by default.
272+
*
273+
* For more information see the Rust documentation at
274+
* https://bytecodealliance.github.io/wasmtime/api/wasmtime/struct.Config.html#method.static_memory_forced.
275+
*/
276+
WASMTIME_CONFIG_PROP(void, static_memory_forced, bool)
277+
268278
/**
269279
* \brief Configures the maximum size for memory to be considered "static"
270280
*

crates/c-api/src/config.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ pub unsafe extern "C" fn wasmtime_config_cache_config_load(
194194
)
195195
}
196196

197+
#[no_mangle]
198+
pub extern "C" fn wasmtime_config_static_memory_forced_set(c: &mut wasm_config_t, enable: bool) {
199+
c.config.static_memory_forced(enable);
200+
}
201+
197202
#[no_mangle]
198203
pub extern "C" fn wasmtime_config_static_memory_maximum_size_set(c: &mut wasm_config_t, size: u64) {
199204
c.config.static_memory_maximum_size(size);

0 commit comments

Comments
 (0)