Commit Graph

811 Commits

Author SHA1 Message Date
8516d07c62 Fix memory leak in C API in some uses of wasm_name_t
Converting from `String` means that the type should auto-destruct to make sure
we free that memory. The memory can still be freed manually though. We need
thorough review for the changes were the `owned_wasm_name_t` is coming from user
code. Is it guaranteed that `wasm_name_t` coming from the user always uses a
host allocation? I don't think so, in which case, we have to find some way to
handle transfer of ownership where it's unclear who owns it...
2021-03-23 13:28:59 -07:00
e1e2f03c7c fix: Rename lib/wasmer-types/ to lib/types/. 2021-03-23 17:36:58 +01:00
9868c0f297 Add wip solution to wasm_extern_as_ no allocation 2021-03-23 09:01:01 -07:00
979b9da566 Merge branch 'master' into feature/reference-types 2021-03-22 11:51:04 -07:00
5650e12f40 Fix wasm_instance_exports exports memory leak in C API tests 2021-03-18 08:30:11 -07:00
1a56ff2cc8 Fix wat and exports memory leak in all examples 2021-03-18 08:16:17 -07:00
b09b85ada5 Update memory Wasm C API example 2021-03-18 07:51:34 -07:00
7ab71dddad Update deprecated C API to use table API correctly
Enable ExternRef in deprecated C API
2021-03-17 09:14:03 -07:00
ea4ea47e17 Merge #2003
2003: chore: Build Wasmer on musl r=jubianchi a=jubianchi


This patch adds a specific build for musl. Currently, it will only support JIT engine.

I also changes the workflow definition a bit so we don't depend on the OS name but rather on the environment ID which is our convention.

Closes #1482
Closes #1766

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: jubianchi <julien@wasmer.io>
2021-03-05 20:24:45 +00:00
1db36fbc34 Merge pull request #2163 from wasmerio/fix-c-api-doc-location
fix: C API location and links are now correct
2021-03-05 11:05:58 -08:00
21ea09f8ff chore(c-api) Fix merge conflicts. 2021-03-05 01:03:54 +01:00
d3f7b7ef70 chore(c-api) Change operator to wasm_operator (reserved keyword in C++). 2021-03-05 00:57:40 +01:00
06a00d9bd0 doc(c-api) Update documentation for clarity. 2021-03-05 00:56:18 +01:00
1700c2d056 feat(c-api) Return ~1 if metering are exhausted. Add wasmer_metering_points_are_exhausted. 2021-03-05 00:49:13 +01:00
96524b5796 chore(c-api) Update headers. 2021-03-05 00:23:46 +01:00
41365360a7 Merge branch 'master' into feature/metering-c-api 2021-03-05 00:18:07 +01:00
feb3963897 fix: C API documentation location and links are now correct 2021-03-04 23:54:40 +01:00
2d20f44365 fix(c-api) Remove useless unsafe marker. 2021-03-04 23:39:43 +01:00
f233ca444e chore(api) The compiler feature enables wasmer-compiler/translator. 2021-03-04 23:17:14 +01:00
4f2ba728dd feat(c-api) Simplify the metering API.
This patch removes the following type and functions:

* `wasmer_metering_points_t`,
* `wasmer_metering_points_delete`,
* `wasmer_metering_points_is_exhausted`,
* `wasmer_metering_points_t`,
* `wasmer_metering_points_unwrap_or`.

Now, `wasmer_metering_get_remaining_points` returns the number of
points, with zero to represent `MeteringPoints::Exhausted`.

The API is greatly simplified as there is no longer need to allocate
and deallocate a `wasmer_metering_points_t` type.
2021-03-04 22:53:02 +01:00
f0024c5994 doc(c-api) Fix typos. 2021-03-04 22:34:04 +01:00
072066acaf Merge branch 'master' into feature/metering-c-api 2021-03-04 22:31:12 +01:00
e7c78e77ee test(c-api) Update tests for the metering API. 2021-03-04 21:49:39 +01:00
0163b33ff3 test(c-api) Update the test to use a custom user-defined cost function. 2021-03-04 17:29:39 +01:00
e2c4f1ee69 feat(c-api) Rename Operator to wasmer_parser_operator_t. 2021-03-04 17:15:28 +01:00
7780423c81 feat(c-api) wasmer_metering_t contains a closure to the cost function. 2021-03-04 17:07:47 +01:00
4fb94aff7e Updated header files 2021-03-03 22:14:12 -08:00
392f50a1af Update dependencies. Use Clap 3.0.0-beta2 instead of StructOpt 2021-03-03 21:47:49 -08:00
52901850a9 chore: Build Wasmer on musl
Closes #1482
Closes #1766
2021-03-03 17:07:47 +01:00
902f58e32d !tmp 2021-03-02 17:42:43 +01:00
0c4e0633f4 chore(c-api) Update headers. 2021-03-02 16:32:54 +01:00
19c04124b1 doc(c-api) Write more documentation and tests. 2021-03-02 16:32:02 +01:00
798dd888c4 feat(c-api) Simplify a compilation condition. 2021-03-02 15:24:48 +01:00
31669b8cdc feat(c-api) Rename wasmer_module_middleware_t to wasmer_middleware_t.
Also, move it into the `unstable::middleware` module.
2021-03-02 15:20:23 +01:00
fb973b2af1 fix(c-api) wasmer_module_middleware_t is an opaque type. 2021-03-02 14:58:18 +01:00
6e50e24643 test(c-api) Add the features example. 2021-03-02 14:48:02 +01:00
8f1a4f3406 feat(c-api) Add wasmer_metering_delete. 2021-03-01 17:31:04 +01:00
e67fd6acf6 feat(c-api) Update headers + add the MIDDLEWARES_FEATURE_AS_C_DEFINE constant. 2021-03-01 17:21:43 +01:00
cb02694abc test(c-api) Add tests for the wasmer_metering_* API. 2021-03-01 17:11:09 +01:00
8b30ae9d41 feat(c-api) Add _delete and rename _value to wasmer_metering_points_unwrap_or. 2021-03-01 17:10:27 +01:00
db4286d576 fix(c-api) Fix merge conflict. 2021-03-01 16:44:04 +01:00
0f43391b78 Merge branch 'master' into feature/metering-c-api 2021-03-01 16:43:16 +01:00
cbbdfdaefa temp 2021-03-01 16:41:44 +01:00
807bd2d1ee feat(c-api) Update headers. 2021-03-01 16:06:20 +01:00
d1fc49d9c2 feat(c-api) Introduce the wasmer_features_t unstable API.
This API is a wrapper around the `wasmer_types::Features` API. A new
function `wasm_config_set_features` allows to define features for the
engine and the compiler.
2021-03-01 16:02:43 +01:00
fd5a9b50d6 chore(c-api) Update headers. 2021-03-01 15:28:37 +01:00
2bc502bd47 fix(c-api) Move the middleware API into the unstable module. 2021-03-01 15:27:56 +01:00
d660943b45 feat(c-api) Simplify &Box<T> to &T. 2021-03-01 15:13:40 +01:00
527d5d97d9 chore(c-api) Fix merge conflicts. 2021-02-18 15:16:00 +01:00
bd25fafeb5 Merge branch 'master' into chore-c-api-formalization 2021-02-18 15:15:11 +01:00