Skip to content

Commit 13bedab

Browse files
Add config setter for wasm_component_model (#269)
* Add gc_support and component model config setters Co-authored-by: effulgentsia <[email protected]> * Postpone SetGCSupport until Wasmtime 43 * Postpone SetGCSupport until Wasmtime 43 --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: effulgentsia <[email protected]>
1 parent 16ef6ba commit 13bedab

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ func (cfg *Config) SetWasmGC(enabled bool) {
143143
runtime.KeepAlive(cfg)
144144
}
145145

146+
// SetWasmComponentModel configures whether the wasm component model proposal is
147+
// enabled.
148+
func (cfg *Config) SetWasmComponentModel(enabled bool) {
149+
C.wasmtime_config_wasm_component_model_set(cfg.ptr(), C.bool(enabled))
150+
runtime.KeepAlive(cfg)
151+
}
152+
146153
// SetWasmWideArithmetic configures whether wide arithmetic is enabled
147154
func (cfg *Config) SetWasmWideArithmetic(enabled bool) {
148155
C.wasmtime_config_wasm_wide_arithmetic_set(cfg.ptr(), C.bool(enabled))

config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ func TestConfig(t *testing.T) {
2121
NewConfig().SetWasmTailCall(true)
2222
NewConfig().SetWasmFunctionReferences(true)
2323
NewConfig().SetWasmGC(true)
24+
NewConfig().SetWasmComponentModel(true)
2425
NewConfig().SetWasmWideArithmetic(true)
2526
NewConfig().SetConsumeFuel(true)
2627
NewConfig().SetStrategy(StrategyAuto)

0 commit comments

Comments
 (0)