Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 0.18.0 API methods #73

Closed
plicease opened this issue Jun 25, 2020 · 1 comment
Closed

Add 0.18.0 API methods #73

plicease opened this issue Jun 25, 2020 · 1 comment

Comments

@plicease
Copy link
Member

diff -ur 0.16.0/include/wasmtime.h 0.18.0/include/wasmtime.h
--- 0.16.0/include/wasmtime.h   2020-05-14 16:28:32.000000000 -0600
+++ 0.18.0/include/wasmtime.h   2020-06-25 14:15:25.000000000 -0600
@@ -117,6 +117,18 @@
     own wasm_trap_t **trap
 );
 
+WASM_API_EXTERN own wasmtime_error_t* wasmtime_linker_module(
+    const wasmtime_linker_t *linker,
+    const wasm_name_t *name,
+    const wasm_module_t *module
+);
+
+WASM_API_EXTERN own wasmtime_error_t* wasmtime_linker_get_default(
+    const wasmtime_linker_t *linker,
+    const wasm_name_t *name,
+    own wasm_func_t **func
+);
+
 ///////////////////////////////////////////////////////////////////////////////
 //
 // wasmtime_caller_t extension, binding the `Caller` type in the Rust API
@@ -232,6 +244,7 @@
 // instance is returned), or an instance can be returned (meaning no error or
 // trap is returned).
 WASM_API_EXTERN own wasmtime_error_t *wasmtime_instance_new(
+    wasm_store_t *store,
     const wasm_module_t *module,
     const wasm_extern_t* const imports[],
     size_t num_imports,
@@ -254,6 +267,32 @@
     const wasm_byte_vec_t *binary
 );
 
+
+// Similar to `wasm_table_*`, except these explicitly operate on funcref tables
+// and work with `wasm_func_t` values instead of `wasm_ref_t`.
+WASM_API_EXTERN own wasmtime_error_t *wasmtime_funcref_table_new(
+    wasm_store_t *store,
+    const wasm_tabletype_t *element_ty,
+    wasm_func_t *init,
+    own wasm_table_t **table
+);
+WASM_API_EXTERN bool wasmtime_funcref_table_get(
+    const wasm_table_t *table,
+    wasm_table_size_t index,
+    own wasm_func_t **func
+);
+WASM_API_EXTERN own wasmtime_error_t *wasmtime_funcref_table_set(
+    wasm_table_t *table,
+    wasm_table_size_t index,
+    const wasm_func_t *value
+);
+WASM_API_EXTERN wasmtime_error_t *wasmtime_funcref_table_grow(
+    wasm_table_t *table,
+    wasm_table_size_t delta,
+    const wasm_func_t *init,
+    wasm_table_size_t *prev_size
+);
+
 #undef own
@plicease
Copy link
Member Author

It is debatable if we need the funcref methods, might make sense to address this when we get to 0.19.0 #75 .
Opened a separate ticket for wasmtime_linker_module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant