wasm-c-api
wasm-c-api copied to clipboard
Wasm C API prototype
```cc own trap; auto instance = Instance::make(store.get(), module.get(), imports, &trap); if (trap) { PrintTrap(trap); return 1; } auto memory = instance.get()->exports()[0]->memory(); assert(memory->kind() == wasm::EXTERN_MEMORY); // SIGSEGV here ``` backtrace: ```...
As I was working on https://github.com/CraneStation/wasmtime/pull/330 I ran into some build issues due to the lack of `v128` support in this library. I do have changes ready for supporting this...
Is it possible to use (call) the same webassebly instance by multiple threads?
I was wondering whether there was any appetite for exposing "regular" C/C++ functions to WebAssembly, e.g. int function_I_have_anyway(int32_t a, int64_t b, double c, float d); (as opposed to functions specifically...
The `wasm_memory_data` function: https://github.com/WebAssembly/wasm-c-api/blob/7865f7daf895dd38961cf421d631d7e24c84e8b6/include/wasm.h#L465 returns a pointer to the linear memory. However, if a `memory.grow` or `wasm_memory_grow` occurs while this pointer remains live, it could cause this pointer to dangle....
make v8: ``` [root@iZrj9d82e7n0tt9r616mvxZ wasm-c-api]# make v8 if ! grep wasm-v8-lowlevel v8/v8/BUILD.gn; then \ cp v8/v8/BUILD.gn v8/v8/BUILD.gn.save; \ cd v8/v8; \ patch < ../../patch/0001-BUILD.gn-add-wasm-v8-lowlevel.patch; \ fi patching file BUILD.gn Hunk...
Consider a module that imports a function and exports it again: ``` (module (func (import "" "f") (export ("f")) ) ``` and host code that triggers this round trip: ```...
The API for getting a table element doesn't directly expose the possibility for the access to fail due to bounds checking: ```c own wasm_ref_t* wasm_table_get(const wasm_table_t*, wasm_table_size_t index); ``` Perhaps...
The API currently exposes the contents of a memory as: ```c byte_t* wasm_memory_data(wasm_memory_t*); size_t wasm_memory_data_size(const wasm_memory_t*); ``` This effectively delegates the bounds checking to the API client. The problem is...