Commit Graph

13 Commits

Author SHA1 Message Date
Ivan Enderlin
c88886f09c Merge branch 'master' into test-c-api-inline-c-rs 2020-11-09 17:19:14 +01:00
Ivan Enderlin
adb84e2bf6 feat(c-api) Allow extern types to own data.
We have known memory leaks with extern types. The idea is to change
the code so that extern types can hold/own data. This patch does that.

A `wasm_externtype_t` holds a `WasmExternType` enum. This enum owns
sibling types such as `WasmFunctionType`, `WasmGlobalType`,
`WasmTableType` and `WasmMemoryType`. It is those structures that ows
the extern types data, like `params` and `results` as
`wasm_valtype_vec_t` for `WasmFunctionType`. That way, for example,
`wasm_functype_t` can return a pointer to these vec which it owns.

A `wasm_externtype_t` continues to be transmuted to `wasm_functype_t`
etc. Nothing changes on that side.
2020-11-09 15:04:22 +01:00
Ivan Enderlin
ede0420920 test(c-api) Free some wasm_valtype_vec_t. 2020-11-05 16:30:39 +01:00
Ivan Enderlin
d2a5b8e101 chore(c-api) Use wasm_$name_vec_t::is_uninitialized(). 2020-10-30 14:16:00 +01:00
Ivan Enderlin
77be1040f6 feat(c-api) Implement wasm_$name_vec_t::is_uninitialized(). 2020-10-30 14:11:09 +01:00
Ivan Enderlin
92e4cf64c1 feat(c-api) Implement wasm_$name_vec_t::into_slice_mut. 2020-10-30 13:29:28 +01:00
Mark McCaskey
e6c61c74ff Update boxed_vec to deal with boxed values 2020-10-02 16:33:03 -07:00
Mark McCaskey
34e6139570 Add conversion logic for boxed_vec, simplify vec creation code 2020-10-02 16:24:46 -07:00
Ivan Enderlin
ae1a50b5d7 chore(c-api) Move cbindgen:ignore from functions/types to modules.
This patch removes the amount of `cbindgen:ignore` instructions by
moving this instruction onto the parent module.
2020-10-02 09:51:48 +02:00
Ivan Enderlin
ecb79e2af0 fix(c-api) Cherry-pick manually from https://github.com/wasmerio/wasmer/pull/1657. 2020-10-01 21:16:29 +02:00
Ivan Enderlin
8f627d9834 feat(c-api) Instruct cbindgen to ignore all functions and types defined in wasm.h. 2020-09-28 14:49:44 +02:00
Ivan Enderlin
1a0527af78 feat(c-api) Move all types into their own modules. 2020-09-24 11:41:04 +02:00
Ivan Enderlin
ebcd59de2b feat(c-api) Extract all macros into their own module. 2020-09-24 09:48:39 +02:00