Ivan Enderlin
d6af40bdd5
fix(c-api) wasm_functype_new frees params and results correctly.
2020-11-16 14:12:53 +01:00
Ivan Enderlin
1a1e38eaea
feat(c-api) Implement From<&wasm_valtype_t> for ValType.
2020-11-16 14:04:17 +01:00
Ivan Enderlin
24b9b1b2e7
fix(c-api) Remove a warning by handling a Result.
2020-11-16 11:33:31 +01:00
Ivan Enderlin
cb3367d377
fix(c-api) Remove a FFI-unsafe operation.
2020-11-16 11:24:48 +01:00
Ivan Enderlin
76d7c4ed1b
feat(c-api) Raise an error when wasm_module_deserialize fails.
2020-11-16 11:19:42 +01:00
Ivan Enderlin
ffad2d7bad
fix(c-api) Fix a typo.
2020-11-16 11:19:17 +01:00
Ivan Enderlin
0eab5926af
doc(c-api) Clarify how destructors work.
2020-11-16 11:14:54 +01:00
Ivan Enderlin
4feaac085c
doc(c-api) Clarify the Rust pattern to handle const *T.
2020-11-16 11:09:21 +01:00
Ivan Enderlin
03b34144bf
feat(c-api) wasm_functype_(params|results) handle null pointers.
2020-11-16 11:09:02 +01:00
Ivan Enderlin
cf9e2fbcdd
chore(c-api) Use Option<&T> rather than Option<NonNull<T>>.
2020-11-16 11:07:02 +01:00
Ivan Enderlin
10555eb01e
doc(c-api) Fix a typo.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
e78114be70
fix(c-api) Add the own annotations for Wasmer specific API.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
73244111a6
fix(c-api) Rewrite wasm_val_copy to use &mut and no unwrap.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
d3c496f8a0
chore(c-api) Code clean up.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
69c23fd78f
doc(c-api) Add the own annotation when necessary.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
3a5fad1ac4
feat(c-api) wasm_module_validate handles null pointers + use into_slice() for bytes.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
cf0098ffd0
feat(c-api) wasm_module_new handles null pointers + use into_slice() for bytes.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
ce10285be2
fix(c-api) Remove done TODO.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
152f1d980c
feat(c-api) wasm_instance_new handles null pointers.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
35c4329150
feat(c-api) Generate errors when wasm_engine_new fails.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
ba6115f348
feat(c-api) More functions handle null pointers + rename variables.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
6f2957b4b3
feat(c-api) More functions handle null pointers.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
5db1ab7c37
feat(c-api) More functions handle null pointers.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
0ce3b27da1
feat(c-api) wasm_global_new handles null pointers.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
e27ce51303
feat(c-api) wasm_func_call handles null pointers.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
b42c699be0
feat(c-api) Support null pointers in wasm_func_new_with_env.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
2735461caf
feat(c-api) wasm_func_new supports null pointers for its arguments.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
19cc55fb0d
doc(c-api) Add another possible Rust pattern
2020-11-16 10:49:37 +01:00
Ivan Enderlin
ee71166f65
doc(c-api) Remove the // own inline doc.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
3df35e1aff
fix(c-api) Fix memory leak in wasm_functype_new.
...
`wasm_functype_new` takes the ownership of `params` and `results`. By
using `Box`, we are sure they are dropped correctly inside the
function.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
84d807716e
doc(c-api) Add Dvelopment Notes.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
8ef36491d4
fix(c-api) wasm_exporttype_t owns its data.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
f3a542eb8c
doc(c-api) Remove an outdated comment.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
d7bcf0442a
fix(c-api) Correctly drop wasm_importtype_vec_t from wasm_module_imports.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
cc04d67263
fix(c-api) Fix a segfault and detect a new memory leak.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
4ab83ed545
fix(c-api) Remove TODO for From<&ImportType> for wasm_importtype_t.
...
A `String` is a `Vec<u8>` by definition, nothing more. Freeing one is
like freeing another.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
8bdfad18d1
fix(c-api) wasm_importtype_t _owns_ its fields.
...
The `wasm.h` file defines `wasm_importtype_new` to take ownership of
the module, the name, and the extern type. This patch thus changes
`NonNull` to `Box` for those types.
`wasm_importtype_new` also handles null pointer with `Option<Box<T>>`
and returns an `Option<Box<T>>`.
The rest of the code is simplified. The patch fixes also some typos in
variable namings.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
9635e43c08
fix(c-api) Remove the memory leak in wasm_tabletype_element.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
7212ab45fd
fix(c-api) Remove memory leaks with wasm_tabletype_limits.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
1604999595
fix(c-api) Remove memory leak with wasm_globaltype_content.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
598c4cc276
fix(c-api) Remove memory leak with wasm_memorytype_limits.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
f49a10411e
chore(c-api) Return references instead of pointers.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
7b727ccffe
chore(c-api) Remove a warning by commenting an unreachable code.
2020-11-16 10:49:37 +01:00
Ivan Enderlin
cf9b1018c1
fix(c-api) Use the newly release of inline-c-rs.
2020-11-16 10:11:01 +01:00
jubianchi
96a0d73ef8
fix(c-api): Remove the use of to link to Wasmer C API.
2020-11-13 21:09:04 +01:00
Ivan Enderlin
458daebe8c
fix(c-api) Add -rpath to the linker only on Linux.
2020-11-13 17:04:10 +01:00
Ivan Enderlin
7cfd2ad161
fix(c-api) Use latest version of inline-c-rs and fix rpath on Linux.
2020-11-13 15:23:21 +01:00
Ivan Enderlin
7c363ea451
test(c-api) Fix segfault.
2020-11-10 10:57:47 +01:00
Ivan Enderlin
5bbfc54757
chore(c-api) Run clang-format.
2020-11-10 10:53:20 +01:00
Ivan Enderlin
3c3c033cbd
chore(c-api) Fix CS.
2020-11-10 10:51:18 +01:00