Wasmtime
config.hh File Reference
#include <wasmtime/conf.h>
#include <wasmtime/config.h>
#include <wasmtime/error.hh>
#include <wasmtime/helpers.hh>
#include <wasmtime/types/memory.hh>

Go to the source code of this file.

Data Structures

class  wasmtime::MemoryRequest
 Parameters of a request to create a new linear memory, passed to a custom memory creator. Only valid for the duration of that call. More...
 
class  wasmtime::PoolAllocationConfig
 Pool allocation configuration for Wasmtime. More...
 
class  wasmtime::Config
 Configuration for Wasmtime. More...
 

Enumerations

enum class  wasmtime::Strategy { Auto = WASMTIME_STRATEGY_AUTO , Cranelift = WASMTIME_STRATEGY_CRANELIFT , Winch = WASMTIME_STRATEGY_WINCH }
 Strategies passed to Config::strategy More...
 
enum class  wasmtime::OptLevel { None = WASMTIME_OPT_LEVEL_NONE , Speed = WASMTIME_OPT_LEVEL_SPEED , SpeedAndSize = WASMTIME_OPT_LEVEL_SPEED_AND_SIZE }
 Values passed to Config::cranelift_opt_level More...
 
enum class  wasmtime::ProfilingStrategy { None = WASMTIME_PROFILING_STRATEGY_NONE , Jitdump = WASMTIME_PROFILING_STRATEGY_JITDUMP , Vtune = WASMTIME_PROFILING_STRATEGY_VTUNE , Perfmap = WASMTIME_PROFILING_STRATEGY_PERFMAP }
 Values passed to Config::profiler More...
 
enum  wasmtime::RegallocAlgorithm { wasmtime::Backtracking = WASMTIME_REGALLOC_BACKTRACKING , wasmtime::SinglePass = WASMTIME_REGALLOC_SINGLE_PASS }
 Values passed to Config::cranelift_regalloc_algorithm More...
 
enum class  wasmtime::MemoryKind { LinearMemory = WASMTIME_MEMORY_KIND_LINEAR_MEMORY , GcHeap = WASMTIME_MEMORY_KIND_GC_HEAP }
 The kind of memory a custom memory creator is asked to create. More...
 

Enumeration Type Documentation

◆ MemoryKind

enum class wasmtime::MemoryKind
strong

The kind of memory a custom memory creator is asked to create.

https://docs.wasmtime.dev/api/wasmtime/enum.MemoryKind.html

Enumerator
LinearMemory 

A standard WebAssembly linear memory (module or host).

GcHeap 

The memory backing a store's GC heap.

It differs from standard linear memory:

  • It is created lazily, at most once per store: when a module that needs a GC heap is instantiated or when the first GC object is allocated. This might happen in the middle of execution of WebAssembly code.
  • It grows as GC objects are allocated, independently of memory.grow.
  • Its contents are Wasmtime's internal representation of GC objects, not data of the guest program. They are only meaningful to the store that created the GC heap, so they should not be shared, persisted, copied to other memories, etc.

◆ OptLevel

enum class wasmtime::OptLevel
strong

Values passed to Config::cranelift_opt_level

Enumerator
None 

No extra optimizations performed.

Speed 

Optimize for speed.

SpeedAndSize 

Optimize for speed and generated code size.

◆ ProfilingStrategy

enum class wasmtime::ProfilingStrategy
strong

Values passed to Config::profiler

Enumerator
None 

No profiling enabled.

Jitdump 

Profiling hooks via perf's jitdump.

Vtune 

Profiling hooks via VTune.

Perfmap 

Profiling hooks via perfmap.

◆ RegallocAlgorithm

Values passed to Config::cranelift_regalloc_algorithm

Enumerator
Backtracking 

Generates the fastest possible code, but may take longer.

This algorithm performs “backtracking”, which means that it may undo its earlier work and retry as it discovers conflicts. This results in better register utilization, producing fewer spills and moves, but can cause super-linear compile runtime.

SinglePass 

Generates acceptable code very quickly.

This algorithm performs a single pass through the code, guaranteed to work in linear time. (Note that the rest of Cranelift is not necessarily guaranteed to run in linear time, however.) It cannot undo earlier decisions, however, and it cannot foresee constraints or issues that may occur further ahead in the code, so the code may have more spills and moves as a result.

◆ Strategy

enum class wasmtime::Strategy
strong

Strategies passed to Config::strategy

Enumerator
Auto 

Automatically selects the compilation strategy.

Cranelift 

Requires Cranelift to be used for compilation.

Winch 

Use winch for compilation.