🌻 📖 Wasm::Wasmtime::Config

NAME

Wasm::Wasmtime::Config - Global configuration for Wasm::Wasmtime::Engine

VERSION

version 0.23

SYNOPSIS

 use Wasm::Wasmtime;
 
 my $config = Wasm::Wasmtime::Config->new;
 $config->wasm_multi_value(1);
 my $engine = Wasm::Wasmtime::Engine->new($config);

DESCRIPTION

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.

CONSTRUCTOR

new

 my $config = Wasm::Wasmtime::Config->new;

Create a new instance of the config class.

METHODS

debug_info

 $config->debug_info($bool);

Configures whether DWARF debug information is emitted for the generated code. This can improve profiling and the debugging experience.

interruptable

 $config->interruptable($bool);

Configures whether functions and loops will be interruptable.

max_wasm_stack

 $config->max_wasm_stack($size);

Configures the maximum amount of native stack space available to executing WebAssembly code

wasm_threads

 $config->wasm_threads($bool);

Configures whether the wasm threads proposal is enabled

https://github.com/webassembly/threads

wasm_reference_types

 $config->wasm_reference_types($bool);

Configures whether the wasm reference types proposal is enabled.

https://github.com/webassembly/reference-types

wasm_simd

 $config->wasm_simd($bool);

Configures whether the wasm SIMD proposal is enabled.

https://github.com/webassembly/simd

wasm_bulk_memory

 $config->wasm_bulk_memory($bool);

Configures whether the wasm bulk memory proposal is enabled.

https://github.com/webassembly/bulk-memory

wasm_multi_value

 $config->wasm_multi_value($bool)

Configures whether the wasm multi value proposal is enabled.

https://github.com/webassembly/multi-value

static_memory_maximum_size

 $config->static_memory_maximum_size($size);

Configure the static memory maximum size.

static_memory_guard_size

 $config->static_memory_guard_size($size);

Configure the static memory guard size.

dynamic_memory_guard_size

 $config->dynamic_memory_guard_size($size);

Configure the dynamic memory guard size.

strategy

 $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

cranelift_opt_level

 $config->cranelift_opt_level($level);

Configure the cranelift optimization level:

Acceptable values for $level are:

none
speed
speed_and_size

profiler

 $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

cache_config_load

 $config->cache_config_load($toml_config);

Path to the cache configuration TOML file.

cache_config_default

 $config->cache_config_default;

Enable the default caching configuration.

consume_fuel

 $config->consume_fuel($bool);

Whether or not fuel is enabled for generated code.

max_instances

 $confog->max_instances($size);

Configures the maximum number of instances that can be created.

SEE ALSO

Wasm
Wasm::Wasmtime

AUTHOR

Graham Ollis <plicease@cpan.org>

COPYRIGHT AND LICENSE

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.