Skip to content

Commit

Permalink
PR comments (bytecodealliance#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobappleyard committed Dec 4, 2024
1 parent 04003d9 commit 8b0ade0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,36 +125,36 @@ func (cfg *Config) SetWasmMemory64(enabled bool) {
runtime.KeepAlive(cfg)
}

// SetConsumFuel configures whether fuel is enabled
func (cfg *Config) SetConsumeFuel(enabled bool) {
C.wasmtime_config_consume_fuel_set(cfg.ptr(), C.bool(enabled))
runtime.KeepAlive(cfg)
}

// SetTailCall configures whether tail calls are enabled
func (cfg *Config) SetTailCall(enabled bool) {
func (cfg *Config) SetWasmTailCall(enabled bool) {
C.wasmtime_config_wasm_tail_call_set(cfg.ptr(), C.bool(enabled))
runtime.KeepAlive(cfg)
}

// SetFunctionReferences configures whether function references are enabled
func (cfg *Config) SetFunctionReferences(enabled bool) {
func (cfg *Config) SetWasmFunctionReferences(enabled bool) {
C.wasmtime_config_wasm_function_references_set(cfg.ptr(), C.bool(enabled))
runtime.KeepAlive(cfg)
}

// SetGC configures whether GC is enabled
func (cfg *Config) SetGC(enabled bool) {
// SetGC configures whether garbage collection is enabled
func (cfg *Config) SetWasmGC(enabled bool) {
C.wasmtime_config_wasm_gc_set(cfg.ptr(), C.bool(enabled))
runtime.KeepAlive(cfg)
}

// SetWideArithmetic configures whether wide arithmetic is enabled
func (cfg *Config) SetWideArithmetic(enabled bool) {
func (cfg *Config) SetWasmWideArithmetic(enabled bool) {
C.wasmtime_config_wasm_wide_arithmetic_set(cfg.ptr(), C.bool(enabled))
runtime.KeepAlive(cfg)
}

// SetConsumFuel configures whether fuel is enabled
func (cfg *Config) SetConsumeFuel(enabled bool) {
C.wasmtime_config_consume_fuel_set(cfg.ptr(), C.bool(enabled))
runtime.KeepAlive(cfg)
}

// SetParallelCompilation configures whether compilation should use multiple threads
func (cfg *Config) SetParallelCompilation(enabled bool) {
C.wasmtime_config_parallel_compilation_set(cfg.ptr(), C.bool(enabled))
Expand Down
8 changes: 4 additions & 4 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ func TestConfig(t *testing.T) {
NewConfig().SetWasmBulkMemory(true)
NewConfig().SetWasmMultiValue(true)
NewConfig().SetWasmMultiMemory(true)
NewConfig().SetWasmTailCall(true)
NewConfig().SetWasmFunctionReferences(true)
NewConfig().SetWasmGC(true)
NewConfig().SetWasmWideArithmetic(true)
NewConfig().SetConsumeFuel(true)
NewConfig().SetStrategy(StrategyAuto)
NewConfig().SetStrategy(StrategyCranelift)
Expand All @@ -26,10 +30,6 @@ func TestConfig(t *testing.T) {
NewConfig().SetCraneliftOptLevel(OptLevelSpeed)
NewConfig().SetCraneliftOptLevel(OptLevelSpeedAndSize)
NewConfig().SetProfiler(ProfilingStrategyNone)
NewConfig().SetTailCall(true)
NewConfig().SetFunctionReferences(true)
NewConfig().SetGC(true)
NewConfig().SetWideArithmetic(true)
NewConfig().SetParallelCompilation(true)
NewConfig().SetCraneliftNanCanonicalization(true)
NewConfig().SetNativeUnwindInfo(true)
Expand Down

0 comments on commit 8b0ade0

Please sign in to comment.