Wasmtime
sharedmemory.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_SHAREDMEMORY_H
8#define WASMTIME_SHAREDMEMORY_H
9
10#include <wasm.h>
11#include <wasmtime/conf.h>
12#include <wasmtime/error.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
24typedef struct wasmtime_sharedmemory wasmtime_sharedmemory_t;
25
26#ifdef WASMTIME_FEATURE_THREADS
27
38WASM_API_EXTERN wasmtime_error_t *
40 const wasm_memorytype_t *ty,
42
43#endif // WASMTIME_FEATURE_THREADS
44
50WASM_API_EXTERN void
52
61WASM_API_EXTERN wasmtime_sharedmemory_t *
63
67WASM_API_EXTERN wasm_memorytype_t *
69
74WASM_API_EXTERN uint8_t *
76
80WASM_API_EXTERN size_t
82
86WASM_API_EXTERN uint64_t
88
100WASM_API_EXTERN wasmtime_error_t *
102 uint64_t delta, uint64_t *prev_size);
103
104#ifdef __cplusplus
105} // extern "C"
106#endif
107
108#endif // WASMTIME_SHAREDMEMORY_H
Build-time defines for how the C API was built.
Definition and accessors of wasmtime_error_t.
void wasmtime_sharedmemory_delete(wasmtime_sharedmemory_t *memory)
Deletes shared linear memory.
uint64_t wasmtime_sharedmemory_size(const wasmtime_sharedmemory_t *memory)
Returns the length, in WebAssembly pages, of this shared linear memory.
struct wasmtime_sharedmemory wasmtime_sharedmemory_t
Interface for shared memories.
Definition: sharedmemory.h:24
wasm_memorytype_t * wasmtime_sharedmemory_type(const wasmtime_sharedmemory_t *memory)
Returns the type of the shared memory specified.
uint8_t * wasmtime_sharedmemory_data(const wasmtime_sharedmemory_t *memory)
Returns the base pointer in memory where the shared linear memory starts.
wasmtime_error_t * wasmtime_sharedmemory_new(const wasm_engine_t *engine, const wasm_memorytype_t *ty, wasmtime_sharedmemory_t **ret)
Creates a new WebAssembly shared linear memory.
wasmtime_sharedmemory_t * wasmtime_sharedmemory_clone(const wasmtime_sharedmemory_t *memory)
Clones shared linear memory.
size_t wasmtime_sharedmemory_data_size(const wasmtime_sharedmemory_t *memory)
Returns the byte length of this shared linear memory.
wasmtime_error_t * wasmtime_sharedmemory_grow(const wasmtime_sharedmemory_t *memory, uint64_t delta, uint64_t *prev_size)
Attempts to grow the specified shared memory by delta pages.
Compilation environment and configuration.
An opaque object representing the type of a memory.
Errors generated by Wasmtime.