Wasmtime
types/val.h File Reference

Go to the source code of this file.

Data Structures

union  wasmtime_heaptype_union
 Payload of the wasmtime_heaptype_t union. More...
 
struct  wasmtime_heaptype
 A WebAssembly heap type. More...
 
struct  wasmtime_reftype
 A WebAssembly reference type. More...
 
struct  wasmtime_valtype
 A WebAssembly value type. More...
 

Macros

#define WASMTIME_HEAPTYPE_KIND_EXTERN   0
 Heap type for the abstract extern type.
 
#define WASMTIME_HEAPTYPE_KIND_NOEXTERN   1
 Heap type for the abstract noextern type.
 
#define WASMTIME_HEAPTYPE_KIND_FUNC   2
 Heap type for the abstract func type.
 
#define WASMTIME_HEAPTYPE_KIND_CONCRETE_FUNC   3
 Heap type for a concrete function type.
 
#define WASMTIME_HEAPTYPE_KIND_NOFUNC   4
 Heap type for the abstract nofunc type.
 
#define WASMTIME_HEAPTYPE_KIND_ANY   5
 Heap type for the abstract any type.
 
#define WASMTIME_HEAPTYPE_KIND_NONE   6
 Heap type for the abstract none type.
 
#define WASMTIME_HEAPTYPE_KIND_EQ   7
 Heap type for the abstract eq type.
 
#define WASMTIME_HEAPTYPE_KIND_I31   8
 Heap type for the abstract i31 type.
 
#define WASMTIME_HEAPTYPE_KIND_ARRAY   9
 Heap type for the abstract array type.
 
#define WASMTIME_HEAPTYPE_KIND_CONCRETE_ARRAY   10
 Heap type for a concrete array type.
 
#define WASMTIME_HEAPTYPE_KIND_STRUCT   11
 Heap type for the abstract struct type.
 
#define WASMTIME_HEAPTYPE_KIND_CONCRETE_STRUCT   12
 Heap type for a concrete struct type.
 
#define WASMTIME_HEAPTYPE_KIND_EXN   13
 Heap type for the abstract exn type.
 
#define WASMTIME_HEAPTYPE_KIND_CONCRETE_EXN   14
 Heap type for a concrete exception type.
 
#define WASMTIME_HEAPTYPE_KIND_NOEXN   15
 Heap type for the abstract noexn type.
 
#define WASMTIME_VALTYPE_KIND_I32   0
 The WebAssembly i32 type.
 
#define WASMTIME_VALTYPE_KIND_I64   1
 The WebAssembly i64 type.
 
#define WASMTIME_VALTYPE_KIND_F32   2
 The WebAssembly f32 type.
 
#define WASMTIME_VALTYPE_KIND_F64   3
 The WebAssembly f64 type.
 
#define WASMTIME_VALTYPE_KIND_V128   4
 The WebAssembly v128 type.
 
#define WASMTIME_VALTYPE_KIND_REF   5
 A WebAssembly reference type.
 

Typedefs

typedef uint8_t wasmtime_heaptype_kind_t
 Discriminant located in wasmtime_heaptype_t.kind
 
typedef union wasmtime_heaptype_union wasmtime_heaptype_union_t
 Payload of the wasmtime_heaptype_t union.
 
typedef struct wasmtime_heaptype wasmtime_heaptype_t
 A WebAssembly heap type.
 
typedef struct wasmtime_reftype wasmtime_reftype_t
 A WebAssembly reference type.
 
typedef uint8_t wasmtime_valtype_kind_t
 Discriminant located in wasmtime_valtype_t.kind
 
typedef struct wasmtime_valtype wasmtime_valtype_t
 A WebAssembly value type. More...
 

Functions

WASM_API_EXTERN wasm_valtype_twasmtime_wasm_valtype_v128 (void)
 Returns a new value type representing the wasm v128 type.
 
WASM_API_EXTERN bool wasmtime_wasm_valtype_equal (const wasm_valtype_t *a, const wasm_valtype_t *b)
 Returns whether a is logically equal to b.
 
WASM_API_EXTERN void wasmtime_heaptype_clone (const wasmtime_heaptype_t *ty, wasmtime_heaptype_t *out)
 Clones ty into out.
 
WASM_API_EXTERN void wasmtime_heaptype_delete (wasmtime_heaptype_t *ty)
 Deletes any payload of ty, if applicable. More...
 
WASM_API_EXTERN void wasmtime_reftype_clone (const wasmtime_reftype_t *ty, wasmtime_reftype_t *out)
 Clones ty into out.
 
WASM_API_EXTERN void wasmtime_reftype_delete (wasmtime_reftype_t *ty)
 Deletes any payload of ty, if applicable. More...
 
WASM_API_EXTERN void wasmtime_valtype_new (const wasm_valtype_t *ty, wasmtime_valtype_t *out)
 Creates a new type in out from the type in ty.
 
WASM_API_EXTERN void wasmtime_valtype_clone (const wasmtime_valtype_t *ty, wasmtime_valtype_t *out)
 Clones ty into out.
 
WASM_API_EXTERN void wasmtime_valtype_delete (wasmtime_valtype_t *ty)
 Deletes any payload of ty, if applicable. More...
 
WASM_API_EXTERN wasm_valtype_twasmtime_valtype_to_wasm (const wasm_engine_t *engine, const wasmtime_valtype_t *ty)
 Converts ty into a wasm_valtype_t and returns a pointer to it. More...
 

Detailed Description

Wasmtime-specific extensions for wasm_valtype_t and structures for working with the full breadth of value types in the wasm type system.

Typedef Documentation

◆ wasmtime_valtype_t

A WebAssembly value type.

Note that this is a parallel representation to wasm_valtype_t which is intended to support the entire breadth of WebAssembly that wasmtime supports.

Function Documentation

◆ wasmtime_heaptype_delete()

WASM_API_EXTERN void wasmtime_heaptype_delete ( wasmtime_heaptype_t ty)

Deletes any payload of ty, if applicable.

Only necessary to call for concrete types.

◆ wasmtime_reftype_delete()

WASM_API_EXTERN void wasmtime_reftype_delete ( wasmtime_reftype_t ty)

Deletes any payload of ty, if applicable.

Only necessary if ty->heaptype is concrete.

◆ wasmtime_valtype_delete()

WASM_API_EXTERN void wasmtime_valtype_delete ( wasmtime_valtype_t ty)

Deletes any payload of ty, if applicable.

Only necessary when ty is a concrete reference type.

◆ wasmtime_valtype_to_wasm()

WASM_API_EXTERN wasm_valtype_t * wasmtime_valtype_to_wasm ( const wasm_engine_t engine,
const wasmtime_valtype_t ty 
)

Converts ty into a wasm_valtype_t and returns a pointer to it.

The caller must deallocate the returned value.