Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Expose gc_support config option to the C API (#12630)

effulgentsia12e29c22879a
diff --git a/crates/c-api/include/wasmtime/config.h b/crates/c-api/include/wasmtime/config.h
index af5f3e0f06..978b613c37 100644
--- a/crates/c-api/include/wasmtime/config.h
+++ b/crates/c-api/include/wasmtime/config.h
@@ -189,6 +189,14 @@ WASMTIME_CONFIG_PROP(void, wasm_function_references, bool)
*/
WASMTIME_CONFIG_PROP(void, wasm_gc, bool)
+/**
+ * \brief Enables or disables GC support in Wasmtime entirely.
+ *
+ * This setting defaults to whether the `gc` feature was enabled at compile
+ * time.
+ */
+WASMTIME_CONFIG_PROP(void, gc_support, bool)
+
/**
* \brief Configures whether the WebAssembly SIMD proposal is
* enabled.
diff --git a/crates/c-api/src/config.rs b/crates/c-api/src/config.rs
index cf132c7490..ea8a42394e 100644
--- a/crates/c-api/src/config.rs
+++ b/crates/c-api/src/config.rs
@@ -107,6 +107,11 @@ pub extern "C" fn wasmtime_config_wasm_gc_set(c: &mut wasm_config_t, enable: boo
c.config.wasm_gc(enable);
}
+#[unsafe(no_mangle)]
+pub extern "C" fn wasmtime_config_gc_support_set(c: &mut wasm_config_t, enable: bool) {
+ c.config.gc_support(enable);
+}
+
#[unsafe(no_mangle)]
pub extern "C" fn wasmtime_config_wasm_simd_set(c: &mut wasm_config_t, enable: bool) {
c.config.wasm_simd(enable);