mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-31 07:12:10 +00:00
Implement basic C API memory functions
This commit is contained in:
@@ -12,6 +12,11 @@ enum class wasmer_compile_result_t {
|
||||
WASMER_COMPILE_ERROR = 2,
|
||||
};
|
||||
|
||||
enum class wasmer_memory_result_t {
|
||||
WASMER_MEMORY_OK = 1,
|
||||
WASMER_MEMORY_ERROR = 2,
|
||||
};
|
||||
|
||||
enum class wasmer_value_tag : uint32_t {
|
||||
WASM_I32,
|
||||
WASM_I64,
|
||||
@@ -37,6 +42,15 @@ struct wasmer_value_t {
|
||||
wasmer_value value;
|
||||
};
|
||||
|
||||
struct wasmer_memory_t {
|
||||
|
||||
};
|
||||
|
||||
struct wasmer_limits_t {
|
||||
uint32_t min;
|
||||
uint32_t max;
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
void wasmer_import_object_destroy(wasmer_import_object_t *import_object);
|
||||
@@ -68,4 +82,10 @@ wasmer_compile_result_t wasmer_instantiate(wasmer_instance_t **instance,
|
||||
uint32_t wasm_bytes_len,
|
||||
wasmer_import_object_t *import_object);
|
||||
|
||||
void wasmer_memory_destroy(wasmer_memory_t *memory);
|
||||
|
||||
uint32_t wasmer_memory_length(wasmer_memory_t *memory);
|
||||
|
||||
wasmer_memory_result_t wasmer_memory_new(wasmer_memory_t **memory, wasmer_limits_t limits);
|
||||
|
||||
} // extern "C"
|
||||
|
Reference in New Issue
Block a user