Wasmtime
wasmtime::Config Class Reference

Configuration for Wasmtime. More...

#include <config.hh>

Public Member Functions

 Config ()
 Creates configuration with all the default settings.
 
void debug_info (bool enable)
 Configures whether dwarf debuginfo is emitted for assisting in-process debugging. More...
 
void epoch_interruption (bool enable)
 Configures whether epochs are enabled which can be used to interrupt currently executing WebAssembly. More...
 
void consume_fuel (bool enable)
 Configures whether WebAssembly code will consume fuel and trap when it runs out. More...
 
void max_wasm_stack (size_t stack)
 Configures the maximum amount of native stack wasm can consume. More...
 
void wasm_threads (bool enable)
 Configures whether the WebAssembly threads proposal is enabled. More...
 
void wasm_tail_call (bool enable)
 Configures whether the WebAssembly tail call proposal is enabled. More...
 
void wasm_reference_types (bool enable)
 Configures whether the WebAssembly reference types proposal is enabled. More...
 
void wasm_simd (bool enable)
 Configures whether the WebAssembly simd proposal is enabled. More...
 
void wasm_relaxed_simd (bool enable)
 Configures whether the WebAssembly relaxed simd proposal is enabled. More...
 
void wasm_relaxed_simd_deterministic (bool enable)
 Configures whether the WebAssembly relaxed simd proposal supports its deterministic behavior. More...
 
void wasm_bulk_memory (bool enable)
 Configures whether the WebAssembly bulk memory proposal is enabled. More...
 
void wasm_multi_value (bool enable)
 Configures whether the WebAssembly multi value proposal is enabled. More...
 
void wasm_multi_memory (bool enable)
 Configures whether the WebAssembly multi memory proposal is enabled. More...
 
void wasm_memory64 (bool enable)
 Configures whether the WebAssembly memory64 proposal is enabled. More...
 
void wasm_gc (bool enable)
 Configures whether the WebAssembly Garbage Collection proposal will be enabled. More...
 
void wasm_function_references (bool enable)
 Configures whether the WebAssembly function references proposal will be enabled. More...
 
void wasm_wide_arithmetic (bool enable)
 Configures whether the WebAssembly wide arithmetic proposal will be enabled. More...
 
void wasm_component_model (bool enable)
 Configures whether the WebAssembly component model proposal will be enabled. More...
 
void parallel_compilation (bool enable)
 Configure whether wasmtime should compile a module using multiple threads. More...
 
void strategy (Strategy strategy)
 Configures compilation strategy for wasm code. More...
 
void cranelift_debug_verifier (bool enable)
 Configures whether cranelift's debug verifier is enabled. More...
 
void cranelift_nan_canonicalization (bool enable)
 Configures whether cranelift's nan canonicalization. More...
 
void cranelift_opt_level (OptLevel level)
 Configures cranelift's optimization level. More...
 
void cranelift_flag_enable (const std::string &flag)
 Enable the specified Cranelift flag. More...
 
void cranelift_flag_set (const std::string &flag, const std::string &value)
 Configure the specified Cranelift flag. More...
 
void profiler (ProfilingStrategy profiler)
 Configures an active wasm profiler. More...
 
void memory_reservation (size_t size)
 Configures the size of the initial linear memory allocation. More...
 
void memory_reservation_for_growth (size_t size)
 Configures the size of the bytes to reserve beyond the end of linear memory to grow into. More...
 
void memory_guard_size (size_t size)
 Configures the size of memory's guard region. More...
 
void memory_may_move (bool enable)
 Configures whether the base pointer of linear memory is allowed to move. More...
 
void memory_init_cow (bool enable)
 Configures whether CoW is enabled. More...
 
void native_unwind_info (bool enable)
 Configures whether native unwind information is emitted. More...
 
void macos_use_mach_ports (bool enable)
 Configures whether mach ports are used on macOS. More...
 
Result< std::monostate > cache_load_default ()
 Loads the default cache configuration present on the system. More...
 
Result< std::monostate > cache_load (const std::string &path)
 Loads cache configuration from the specified filename. More...
 
template<typename T >
void host_memory_creator (T creator)
 Configures a custom memory creator for this configuration and eventual Engine. More...
 
void pooling_allocation_strategy (const PoolAllocationConfig &config)
 Enables and configures the pooling allocation strategy. More...
 

Friends

class Engine
 

Detailed Description

Configuration for Wasmtime.

This class is used to configure Wasmtime's compilation and various other settings such as enabled WebAssembly proposals.

For more information be sure to consult the rust documentation.

Member Function Documentation

◆ cache_load()

Result< std::monostate > wasmtime::Config::cache_load ( const std::string &  path)
inline

Loads cache configuration from the specified filename.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.cache_config_load

◆ cache_load_default()

Result< std::monostate > wasmtime::Config::cache_load_default ( )
inline

Loads the default cache configuration present on the system.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.cache_config_load_default

◆ consume_fuel()

void wasmtime::Config::consume_fuel ( bool  enable)
inline

Configures whether WebAssembly code will consume fuel and trap when it runs out.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.consume_fuel

◆ cranelift_debug_verifier()

void wasmtime::Config::cranelift_debug_verifier ( bool  enable)
inline

Configures whether cranelift's debug verifier is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.cranelift_debug_verifier

◆ cranelift_flag_enable()

void wasmtime::Config::cranelift_flag_enable ( const std::string &  flag)
inline

◆ cranelift_flag_set()

void wasmtime::Config::cranelift_flag_set ( const std::string &  flag,
const std::string &  value 
)
inline

◆ cranelift_nan_canonicalization()

void wasmtime::Config::cranelift_nan_canonicalization ( bool  enable)
inline

◆ cranelift_opt_level()

void wasmtime::Config::cranelift_opt_level ( OptLevel  level)
inline

◆ debug_info()

void wasmtime::Config::debug_info ( bool  enable)
inline

Configures whether dwarf debuginfo is emitted for assisting in-process debugging.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.debug_info

◆ epoch_interruption()

void wasmtime::Config::epoch_interruption ( bool  enable)
inline

Configures whether epochs are enabled which can be used to interrupt currently executing WebAssembly.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.epoch_interruption

◆ host_memory_creator()

template<typename T >
void wasmtime::Config::host_memory_creator ( creator)
inline

Configures a custom memory creator for this configuration and eventual Engine.

This can be used to use creator to allocate linear memories for the engine that this configuration will be used for.

◆ macos_use_mach_ports()

void wasmtime::Config::macos_use_mach_ports ( bool  enable)
inline

◆ max_wasm_stack()

void wasmtime::Config::max_wasm_stack ( size_t  stack)
inline

Configures the maximum amount of native stack wasm can consume.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.max_wasm_stack

◆ memory_guard_size()

void wasmtime::Config::memory_guard_size ( size_t  size)
inline

◆ memory_init_cow()

void wasmtime::Config::memory_init_cow ( bool  enable)
inline

◆ memory_may_move()

void wasmtime::Config::memory_may_move ( bool  enable)
inline

Configures whether the base pointer of linear memory is allowed to move.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.memory_may_move

◆ memory_reservation()

void wasmtime::Config::memory_reservation ( size_t  size)
inline

Configures the size of the initial linear memory allocation.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.memory_reservation

◆ memory_reservation_for_growth()

void wasmtime::Config::memory_reservation_for_growth ( size_t  size)
inline

Configures the size of the bytes to reserve beyond the end of linear memory to grow into.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.memory_reservation_for_growth

◆ native_unwind_info()

void wasmtime::Config::native_unwind_info ( bool  enable)
inline

Configures whether native unwind information is emitted.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.native_unwind_info

◆ parallel_compilation()

void wasmtime::Config::parallel_compilation ( bool  enable)
inline

Configure whether wasmtime should compile a module using multiple threads.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.parallel_compilation

◆ pooling_allocation_strategy()

void wasmtime::Config::pooling_allocation_strategy ( const PoolAllocationConfig config)
inline

Enables and configures the pooling allocation strategy.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.allocation_strategy

◆ profiler()

void wasmtime::Config::profiler ( ProfilingStrategy  profiler)
inline

◆ strategy()

void wasmtime::Config::strategy ( Strategy  strategy)
inline

Configures compilation strategy for wasm code.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.strategy

◆ wasm_bulk_memory()

void wasmtime::Config::wasm_bulk_memory ( bool  enable)
inline

Configures whether the WebAssembly bulk memory proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_bulk_memory

◆ wasm_component_model()

void wasmtime::Config::wasm_component_model ( bool  enable)
inline

Configures whether the WebAssembly component model proposal will be enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_component_model

◆ wasm_function_references()

void wasmtime::Config::wasm_function_references ( bool  enable)
inline

Configures whether the WebAssembly function references proposal will be enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_function_references

◆ wasm_gc()

void wasmtime::Config::wasm_gc ( bool  enable)
inline

Configures whether the WebAssembly Garbage Collection proposal will be enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_gc

◆ wasm_memory64()

void wasmtime::Config::wasm_memory64 ( bool  enable)
inline

Configures whether the WebAssembly memory64 proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_memory64

◆ wasm_multi_memory()

void wasmtime::Config::wasm_multi_memory ( bool  enable)
inline

Configures whether the WebAssembly multi memory proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_multi_memory

◆ wasm_multi_value()

void wasmtime::Config::wasm_multi_value ( bool  enable)
inline

Configures whether the WebAssembly multi value proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_multi_value

◆ wasm_reference_types()

void wasmtime::Config::wasm_reference_types ( bool  enable)
inline

Configures whether the WebAssembly reference types proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_reference_types

◆ wasm_relaxed_simd()

void wasmtime::Config::wasm_relaxed_simd ( bool  enable)
inline

Configures whether the WebAssembly relaxed simd proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_relaxed_simd

◆ wasm_relaxed_simd_deterministic()

void wasmtime::Config::wasm_relaxed_simd_deterministic ( bool  enable)
inline

Configures whether the WebAssembly relaxed simd proposal supports its deterministic behavior.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_relaxed_simd_deterministic

◆ wasm_simd()

void wasmtime::Config::wasm_simd ( bool  enable)
inline

Configures whether the WebAssembly simd proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_simd

◆ wasm_tail_call()

void wasmtime::Config::wasm_tail_call ( bool  enable)
inline

Configures whether the WebAssembly tail call proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_tail_call

◆ wasm_threads()

void wasmtime::Config::wasm_threads ( bool  enable)
inline

Configures whether the WebAssembly threads proposal is enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_threads

◆ wasm_wide_arithmetic()

void wasmtime::Config::wasm_wide_arithmetic ( bool  enable)
inline

Configures whether the WebAssembly wide arithmetic proposal will be enabled.

https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.wasm_wide_arithmetic


The documentation for this class was generated from the following file: