Wasmtime
config.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_CONFIG_H
8#define WASMTIME_CONFIG_H
9
10#include <wasm.h>
11#include <wasmtime/error.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
21typedef uint8_t wasmtime_strategy_t;
22
28enum wasmtime_strategy_enum { // Strategy
32
36};
37
43typedef uint8_t wasmtime_opt_level_t;
44
50enum wasmtime_opt_level_enum { // OptLevel
58};
59
66
72enum wasmtime_profiling_strategy_enum { // ProfilingStrategy
87};
88
89#define WASMTIME_CONFIG_PROP(ret, name, ty) \
90 WASM_API_EXTERN ret wasmtime_config_##name##_set(wasm_config_t *, ty);
91
101WASMTIME_CONFIG_PROP(void, debug_info, bool)
102
103
110WASMTIME_CONFIG_PROP(void, consume_fuel, bool)
111
126WASMTIME_CONFIG_PROP(void, epoch_interruption, bool)
127
141WASMTIME_CONFIG_PROP(void, max_wasm_stack, size_t)
142
150WASMTIME_CONFIG_PROP(void, wasm_threads, bool)
151
157WASMTIME_CONFIG_PROP(void, wasm_tail_call, bool)
158
165WASMTIME_CONFIG_PROP(void, wasm_reference_types, bool)
166
173WASMTIME_CONFIG_PROP(void, wasm_function_references, bool)
174
180WASMTIME_CONFIG_PROP(void, wasm_gc, bool)
181
188WASMTIME_CONFIG_PROP(void, wasm_simd, bool)
189
196WASMTIME_CONFIG_PROP(void, wasm_relaxed_simd, bool)
197
204WASMTIME_CONFIG_PROP(void, wasm_relaxed_simd_deterministic, bool)
205
212WASMTIME_CONFIG_PROP(void, wasm_bulk_memory, bool)
213
220WASMTIME_CONFIG_PROP(void, wasm_multi_value, bool)
221
228WASMTIME_CONFIG_PROP(void, wasm_multi_memory, bool)
229
236WASMTIME_CONFIG_PROP(void, wasm_memory64, bool)
237
243WASMTIME_CONFIG_PROP(void, strategy, wasmtime_strategy_t)
244
252WASMTIME_CONFIG_PROP(void, parallel_compilation, bool)
253
262WASMTIME_CONFIG_PROP(void, cranelift_debug_verifier, bool)
263
277WASMTIME_CONFIG_PROP(void, cranelift_nan_canonicalization, bool)
278
284WASMTIME_CONFIG_PROP(void, cranelift_opt_level, wasmtime_opt_level_t)
285
291WASMTIME_CONFIG_PROP(void, profiler, wasmtime_profiling_strategy_t)
292
301WASMTIME_CONFIG_PROP(void, static_memory_forced, bool)
302
309WASMTIME_CONFIG_PROP(void, static_memory_maximum_size, uint64_t)
310
317WASMTIME_CONFIG_PROP(void, static_memory_guard_size, uint64_t)
318
325WASMTIME_CONFIG_PROP(void, dynamic_memory_guard_size, uint64_t)
326
334WASMTIME_CONFIG_PROP(void, dynamic_memory_reserved_for_growth, uint64_t)
335
345WASMTIME_CONFIG_PROP(void, native_unwind_info, bool)
346
359WASM_API_EXTERN wasmtime_error_t *
361
374WASMTIME_CONFIG_PROP(wasmtime_error_t *, target, const char *)
375
386 const char *);
387
398 const char *key,
399 const char *value);
400
410WASMTIME_CONFIG_PROP(void, macos_use_mach_ports, bool)
411
421typedef uint8_t *(*wasmtime_memory_get_callback_t)(void *env, size_t *byte_size,
422 size_t *maximum_byte_size);
423
431 size_t new_size);
432
441 void *env;
447 void (*finalizer)(void *);
449
461typedef wasmtime_error_t *(*wasmtime_new_memory_callback_t)(
462 void *env, const wasm_memorytype_t *ty, size_t minimum, size_t maximum,
463 size_t reserved_size_in_bytes, size_t guard_size_in_bytes,
464 wasmtime_linear_memory_t *memory_ret);
465
475 void *env;
479 void (*finalizer)(void *);
481
495WASM_API_EXTERN void
498
516WASMTIME_CONFIG_PROP(void, memory_init_cow, bool)
517
518#ifdef __cplusplus
519} // extern "C"
520#endif
521
522#endif // WASMTIME_CONFIG_H
void wasmtime_config_cranelift_flag_set(wasm_config_t *, const char *key, const char *value)
Sets a target-specific flag in Cranelift to the specified value.
wasmtime_error_t * wasmtime_config_cache_config_load(wasm_config_t *, const char *)
Enables Wasmtime's cache and loads configuration from the specified path.
struct wasmtime_memory_creator wasmtime_memory_creator_t
struct wasmtime_linear_memory wasmtime_linear_memory_t
uint8_t wasmtime_strategy_t
Specifier for how Wasmtime will compile code, values are in wasmtime_strategy_enum.
Definition: config.h:21
void wasmtime_config_cranelift_flag_enable(wasm_config_t *, const char *)
Enables a target-specific flag in Cranelift.
uint8_t wasmtime_profiling_strategy_t
Different ways wasmtime can enable profiling JIT code.
Definition: config.h:65
uint8_t *(* wasmtime_memory_get_callback_t)(void *env, size_t *byte_size, size_t *maximum_byte_size)
Definition: config.h:421
wasmtime_profiling_strategy_enum
Different ways to profile JIT code.
Definition: config.h:72
@ WASMTIME_PROFILING_STRATEGY_VTUNE
Definition: config.h:82
@ WASMTIME_PROFILING_STRATEGY_PERFMAP
Definition: config.h:86
@ WASMTIME_PROFILING_STRATEGY_NONE
No profiling is enabled at runtime.
Definition: config.h:74
@ WASMTIME_PROFILING_STRATEGY_JITDUMP
Definition: config.h:77
wasmtime_strategy_enum
Different ways that Wasmtime can compile WebAssembly.
Definition: config.h:28
@ WASMTIME_STRATEGY_CRANELIFT
Definition: config.h:35
@ WASMTIME_STRATEGY_AUTO
Definition: config.h:31
wasmtime_opt_level_enum
Different ways Wasmtime can optimize generated code.
Definition: config.h:50
@ WASMTIME_OPT_LEVEL_SPEED_AND_SIZE
Definition: config.h:57
@ WASMTIME_OPT_LEVEL_NONE
Generated code will not be optimized at all.
Definition: config.h:52
@ WASMTIME_OPT_LEVEL_SPEED
Generated code will be optimized purely for speed.
Definition: config.h:54
void wasmtime_config_host_memory_creator_set(wasm_config_t *, wasmtime_memory_creator_t *)
uint8_t wasmtime_opt_level_t
Specifier of what optimization level to use for generated JIT code.
Definition: config.h:43
wasmtime_error_t *(* wasmtime_new_memory_callback_t)(void *env, const wasm_memorytype_t *ty, size_t minimum, size_t maximum, size_t reserved_size_in_bytes, size_t guard_size_in_bytes, wasmtime_linear_memory_t *memory_ret)
Definition: config.h:461
wasmtime_error_t *(* wasmtime_memory_grow_callback_t)(void *env, size_t new_size)
Definition: config.h:430
Definition and accessors of wasmtime_error_t.
Global engine configuration.
An opaque object representing the type of a memory.
Errors generated by Wasmtime.
Definition: config.h:439
wasmtime_memory_get_callback_t get_memory
Callback to get the memory and size of this LinearMemory.
Definition: config.h:443
void * env
User provided value to be passed to get_memory and grow_memory.
Definition: config.h:441
wasmtime_memory_grow_callback_t grow_memory
Callback to request growing the memory.
Definition: config.h:445
Definition: config.h:473
void(* finalizer)(void *)
An optional finalizer for env.
Definition: config.h:479
wasmtime_new_memory_callback_t new_memory
The callback to create new memory, must be thread safe.
Definition: config.h:477
void * env
User provided value to be passed to new_memory.
Definition: config.h:475