Wasm::Wasmtime::Config - Global configuration for Wasm::Wasmtime::Engine
version 0.24
use Wasm::Wasmtime; my $config = Wasm::Wasmtime::Config->new; $config->wasm_multi_value(1); my $engine = Wasm::Wasmtime::Engine->new($config);
WARNING: WebAssembly and Wasmtime are a moving target and the interface for these modules is under active development. Use with caution.
This class contains the configuration for Wasm::Wasmtime::Engine class. Each instance of the config class should only be used once.
my $config = Wasm::Wasmtime::Config->new;
Create a new instance of the config class.
$config->debug_info($bool);
Configures whether DWARF debug information is emitted for the generated code. This can improve profiling and the debugging experience.
$config->epoch_interruption($bool);
Configures whether execution of WebAssembly will "yield" when a deadline is reached. This replaces the old (removed) interruptable configuration.
$config->consume_fuel($bool);
Whether or not fuel is enabled for generated code. When enabled a store must be given fuel with $store->set_fuel before WebAssembly can execute.
$config->max_wasm_stack($size);
Configures the maximum amount of native stack space available to executing WebAssembly code
$config->wasm_threads($bool);
Configures whether the wasm threads proposal is enabled
https://github.com/webassembly/threads
$config->wasm_reference_types($bool);
Configures whether the wasm reference types proposal is enabled.
https://github.com/webassembly/reference-types
$config->wasm_simd($bool);
Configures whether the wasm SIMD proposal is enabled.
https://github.com/webassembly/simd
$config->wasm_bulk_memory($bool);
Configures whether the wasm bulk memory proposal is enabled.
https://github.com/webassembly/bulk-memory
$config->wasm_multi_value($bool)
Configures whether the wasm multi value proposal is enabled.
https://github.com/webassembly/multi-value
$config->memory_reservation($size);
Configures the size, in bytes, of virtual memory reservation for each linear memory. Setting this (and "memory_guard_size") to 0 disables the large PROT_NONE reservations that can trip ulimit -v limits. Replaces the old (removed) static_memory_maximum_size.
$config->memory_guard_size($size);
Configures the size, in bytes, of the guard region placed after each linear memory. Replaces the old (removed) static_memory_guard_size / dynamic_memory_guard_size.
$config->strategy($strategy);
Configures the compilation strategy used for wasm code.
Acceptable values for $strategy are:
autocraneliftwinch$config->cranelift_opt_level($level);
Configure the cranelift optimization level:
Acceptable values for $level are:
nonespeedspeed_and_size$config->profiler($profiler);
Configure the profiler.
Acceptable values for $profiler are:
nonejitdumpvtuneperfmap$config->cache_config_load($toml_config);
Path to the cache configuration TOML file.
$config->cache_config_default;
Enable the default caching configuration.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2020-2026 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.