Wasm::Wasmtime::Config - Global configuration for Wasm::Wasmtime::Engine
version 0.23
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->interruptable($bool);
Configures whether functions and loops will be interruptable.
$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->static_memory_maximum_size($size);
Configure the static memory maximum size.
$config->static_memory_guard_size($size);
Configure the static memory guard size.
$config->dynamic_memory_guard_size($size);
Configure the dynamic memory guard size.
$config->strategy($strategy);
Configures the compilation strategy used for wasm code.
Will throw an exception if the selected strategy is not supported on your platform.
Acceptable values for $strategy
are:
auto
cranelift
lightbeam
$config->cranelift_opt_level($level);
Configure the cranelift optimization level:
Acceptable values for $level
are:
none
speed
speed_and_size
$config->profiler($profiler);
Configure the profiler.
Will throw an exception if the selected profiler is not supported on your platform.
Acceptable values for $profiler
are:
none
jitdump
vtune
$config->cache_config_load($toml_config);
Path to the cache configuration TOML file.
$config->cache_config_default;
Enable the default caching configuration.
$config->consume_fuel($bool);
Whether or not fuel is enabled for generated code.
$confog->max_instances($size);
Configures the maximum number of instances that can be created.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2020-2022 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.