Commit Graph

145 Commits

Author SHA1 Message Date
4ddffb8285 Update libraries versions to 0.4.2 2019-05-16 14:39:13 -07:00
89f3998b49 Merge branch 'master' into feature/fix-default_compiler-compilation 2019-05-14 18:22:44 -05:00
bef9f1244a Return impl Compiler from default_compiler to fix compilation with features 2019-05-14 18:19:58 -05:00
8bd9bbb508 chore(runtime-c-api) Update C/C++ header files. 2019-05-14 16:19:32 +02:00
f04e77323b fix(runtime-c-api) Update wasmer_export_func_params_arity signature.
The `returns_len` argument type of `wasmer_export_func_returns_params`
must be `uint32_t` to match the `wasmer_export_func_returns_arity` results,
so that casts are not required.
2019-05-14 16:18:41 +02:00
53661385ed chore(runtime-c-api) Update C/C++ header files. 2019-05-14 16:17:13 +02:00
91006bab53 fix(runtime-c-api) Update wasmer_export_func_params_arity signature.
The `params_len` argument type of `wasmer_export_func_params_arity`
must be `uint32_t` to match the `wasmer_export_func_*_arity` results,
so that casts are not required.
2019-05-14 16:15:36 +02:00
2b250c30f3 chore(runtime-c-api) Regenerate C/C++ header files. 2019-05-14 11:50:10 +02:00
f68379a6df test(runtime-c-api) Use *_arity variables when calling wasmer_export_func_call. 2019-05-14 11:49:40 +02:00
d3c75a38fa fix(runtime-c-api) wasmer_instance_call types matches wasmer_export_func_*_arity.
The `wasmer_export_func_params_arity` and
`wasmer_export_func_returns_arity` functions store the arity in a
`uint32_t`. The `wasmer_instance_call` expects `c_int`. There is a
type mismatch here. It's not annoying in C or C++, but in some other
languages that have bindings to C/C++, it can imply useless casting.

This patch changes `wasmer_instance_call` to expect `uint32_t` for
`params_len` and `results_len` to match the
`wasmer_export_func_*_arity` functions.
2019-05-14 11:46:43 +02:00
19eba19603 Merge branch 'master' into doc-runtime-c-api
# Conflicts:
#	lib/runtime-c-api/src/lib.rs
2019-05-13 15:55:20 -07:00
b050144898 Merge branch 'master' into fix-runtime-c-api-error-length 2019-05-13 10:59:11 +02:00
8c8586faaa test(runtime-c-api) Assert returned value from wasmer_last_error_message. 2019-05-13 10:52:55 +02:00
bedd305b06 doc(runtime-c-api) Fix inline comment. 2019-05-13 10:52:43 +02:00
2aefa731a6 Add deny for unreachable patterns and unused unsafe 2019-05-12 00:33:02 -05:00
85158ac22a Add some initial deny for unused_imports and unused_variables
Additional unused variable fix on unix

Remove unused import on unix

Remove unused windows import
2019-05-11 09:23:25 -05:00
7d2721ef7a fix(runtime-c-api) wasmer_last_error_message returns the length + 1.
Returning the error message's length + 1 mimics the
`wasmer_last_error_length` function that counts the trailing null
byte.
2019-05-10 16:00:13 +02:00
1d555301f7 feat(runtime-c-api) Check buffer size before creating the slice.
It's safer to check the buffer size is large enough to hold the error
message before creating the slice from raw parts.

Also, this patch remove the need for `last_error`, simplifying the
code a little bit. The `length` variable is casted to `usize` once.
2019-05-10 15:55:02 +02:00
e5dc94c7d6 update version number to 0.4.1 2019-05-06 18:02:39 -07:00
d020ffd759 update version to 0.4.0 2019-04-29 13:26:51 -07:00
d507253372 update crate version numbers to 0.3.0 2019-04-12 12:19:46 -07:00
1c063090c5 doc(runtime-c-api) Add short module descriptions. 2019-03-29 16:35:35 +01:00
8ee0f16c8a fix(runtime-c-api) Remove last warnings. 2019-03-29 15:56:08 +01:00
849af62911 feat(runtime-c-api) Finish to extract last pieces of code. 2019-03-29 15:52:41 +01:00
361ff81db7 feat(runtime-c-api) Extract the import module. 2019-03-29 15:50:16 +01:00
9c4696eb5b feat(runtime-c-api) Extract the export module. 2019-03-29 15:38:12 +01:00
f46be814da feat(runtime-c-api) Extract the instance module. 2019-03-29 15:14:05 +01:00
d06d6b7ac8 feat(runtime-c-api) Extract the global module. 2019-03-29 15:05:17 +01:00
8bdb458ea7 feat(runtime-c-api) Extract the table module. 2019-03-29 15:02:50 +01:00
4239975240 feat(runtime-c-api) Move wasmer_validate into the module module. 2019-03-29 14:59:02 +01:00
55c010688c feat(runtime-c-api) Extract the memory module. 2019-03-29 14:57:08 +01:00
168aa8031f feat(runtime-c-api) Extract the module module. 2019-03-29 14:51:35 +01:00
96324977b5 feat(runtime-c-api) Extract the error module. 2019-03-29 14:41:39 +01:00
49c01f6093 feat(runtime-c-api) Extract the value module. 2019-03-29 14:40:26 +01:00
a59ce13810 chore(runtime-c-api) Build the C and C++ headers. 2019-03-27 10:50:40 +01:00
4d0312f0ed test(runtime-c-api) New test suite for wasmer_export_to_memory. 2019-03-27 10:49:28 +01:00
6fca475564 feat(runtime-c-api) Implement the wasmer_export_to_memory function.
This new function returns a `wasmer_memory_t` from a
`wasmer_export_t`.
2019-03-27 10:44:47 +01:00
5661540097 chore(runtime-c-api) Move .wasm files into the assets directory. 2019-03-27 09:42:56 +01:00
c0f4b6a87c Merge branch 'master' into feat-runtime-c-api-cache 2019-03-19 16:35:32 +01:00
57a82fa5cf fix(runtime-c-api) wasmer_serialized_module_from_bytes accepts bytes + length instead of wasmer_byte_array. 2019-03-19 16:24:59 +01:00
44373aae94 feat(runtime-c-api) Mirrors the debug and llvm features.
`wasmer-runtime` has a `debug` and a `llvm` features. Let's mirror
them in `wasmer-runtime-c-api` so that the user can, for instance,
compile with the LLVM backend.
2019-03-19 11:12:19 +01:00
46edd20725 feat(runtime-c-api) Add the wasmer_serialized_module_from_bytes function.
This function is required to transform a `wasmer_byte_array` into a
`wasmer_serialized_module_t`. This is the complementary function of
`wasmer_serialized_module_bytes`.
2019-03-19 10:51:43 +01:00
5e31a1b6d1 feat(runtime-c-api) Introduce the wasmer_serialized_module_t struct type.
The `wasmer_module_serialize` function now computes a
`wasmer_serialized_module_t` value. The `wasmer_module_deserialize`
function takes this value as an input. Same for
`wasmer_serialized_module_destroy`.

The new function `wasmer_serialized_module_bytes` allows to read the
bytes inside the `wasmer_serialized_mdule_t` structure.
2019-03-19 10:04:31 +01:00
f049e9b0b3 fix(runtime-c-api) Remove explicity drop.
When the value goes out-of-scope, `drop` is called utomatically.
2019-03-18 16:09:02 +01:00
6605a02316 feat(runtime-c-api) Add the wasmer_module_serialization_destroy function. 2019-03-18 16:05:04 +01:00
aac5c88b58 doc(runtime-c-api) Update the documentation of wasmer_module_deserialize. 2019-03-15 12:18:52 +01:00
082c93ceba chore(runtime-c-api) Fix a merging error. 2019-03-15 12:04:23 +01:00
2368ce3a20 chore(runtime-c-api) Regenerate the wasmer.hh? files. 2019-03-15 12:04:23 +01:00
c8872f1a6f test(runtime-c-api) Test the new wasmer_module_(de)?serialize functions.
This test suite compiles a module, then serializes it, deserializes
it, and continues by creating an instance and calling a function on
it. It allows to test the entire roundtrip.
2019-03-15 12:04:23 +01:00
f2760249b6 fix(runtime-c-api) Reorganize the tests by alphabetic order. 2019-03-15 12:04:23 +01:00