Skip to content

Commit 12e29c2

Browse files
authored
Expose gc_support config option to the C API (#12630)
* (feat) Add gc_support config option within C API * Restored 'gc' feature to wasmtime dependency Removing the unconditional `gc` dependency requires additional guards so postponing that work.
1 parent ee7e125 commit 12e29c2

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ WASMTIME_CONFIG_PROP(void, wasm_function_references, bool)
189189
*/
190190
WASMTIME_CONFIG_PROP(void, wasm_gc, bool)
191191

192+
/**
193+
* \brief Enables or disables GC support in Wasmtime entirely.
194+
*
195+
* This setting defaults to whether the `gc` feature was enabled at compile
196+
* time.
197+
*/
198+
WASMTIME_CONFIG_PROP(void, gc_support, bool)
199+
192200
/**
193201
* \brief Configures whether the WebAssembly SIMD proposal is
194202
* enabled.

crates/c-api/src/config.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ pub extern "C" fn wasmtime_config_wasm_gc_set(c: &mut wasm_config_t, enable: boo
107107
c.config.wasm_gc(enable);
108108
}
109109

110+
#[unsafe(no_mangle)]
111+
pub extern "C" fn wasmtime_config_gc_support_set(c: &mut wasm_config_t, enable: bool) {
112+
c.config.gc_support(enable);
113+
}
114+
110115
#[unsafe(no_mangle)]
111116
pub extern "C" fn wasmtime_config_wasm_simd_set(c: &mut wasm_config_t, enable: bool) {
112117
c.config.wasm_simd(enable);

0 commit comments

Comments
 (0)