923: Add probable fix of memory leak in trampoline code r=MarkMcCaskey a=MarkMcCaskey
might be what's needed for #810 ; but despite my best efforts I could not get asan working on osx, so I did not test it.
By my count this accounts for 40 bytes, so there may be another issue
edit: unless Rust is optimizing out turning a zero-sized type into a Box, in which case, this should account for 48 bytes
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Host functions use `Context::External` with a `*mut vm::FuncCtx`
pointer, casted to `*mut vm::Ctx`. It creates a conflict with exports
that also use `Context::External`.
This patch introduces `Context::ExternalWithEnv` to create a specific
path in the code for an external context with `*mut vm::FuncEnv`.
This patch fixes all the `linking.wast` tests in the spectests.
In the `wrap` functions, we use `std::mem::transmute(&())` to get the
pointer to the value “around” `wrap` (`Fn` has a method `to_raw` which
declares a `wrap` function, which uses `transmute` to retrieve
`Fn`). This is an undefined behavior. It was working until the
`FuncCtx` is introduced. Since then, the undefined behavior was
causing an error with the Singlepass backend.
This patch stores the pointer to `Fn` in `func_env`, so that the
pointer to the user-defined host function is always predictable.
929: Update __wasi_rights_t and __wasi_signal_t with published changes r=MarkMcCaskey a=MarkMcCaskey
Follow up to #926 ; fixes everything else listed at https://github.com/WebAssembly/WASI/pull/135
Co-authored-by: Mark McCaskey <mark@wasmer.io>
911: Don't emit bounds checks when the offset is known at compile time to be less than the minimum memory size. r=nlewycky a=nlewycky
Co-authored-by: Nick Lewycky <nick@wasmer.io>
915: fix(runtime-core) Share the definition of `Trampoline` across all the backends r=Hywan a=Hywan
Extracted from https://github.com/wasmerio/wasmer/pull/882.
This patch updates all the backends to use the definition of
`Trampoline` as defined in the `wasmer_runtime_core::typed_func`
module. That way, there is no copy of that type, and as such, it is
easier to avoid regression (a simple `cargo check` does the job).
This patch also formats the `use` statements in the updated files.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
This patch allows host functions to get a signature without an
explicit `vm::Ctx` argument.
It is for Rust only. The C API receives a function pointer and has no
clue whether a `vm::Ctx` argument is present or not, so it assumes it
is always declared.
From the backend point of view, the pointer to `vm::Ctx` is always
inserted in the stack, but it is not used by the function when the
argument is absent.
916: feat(runtime-core-tests) Introduce the new `wasmer-runtime-core-tests` crate r=Hywan a=Hywan
Extracted from https://github.com/wasmerio/wasmer/pull/882.
This non-publishable new crate contains a test suite for the
`wasmer-runtime-core` crate. So far, the test suite is rather small,
but it aims to be extended in a close future.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
This non-publishable new crate contains a test suite for the
`wasmer-runtime-core` crate. So far, the test suite is rather small,
but it aims to be extended in a close future.
This patch updates all the backends to use the definition of
`Trampoline` as defined in the `wasmer_runtime_core::typed_func`
module. That way, there is no copy of that type, and as such, it is
easier to avoid regression (a simple `cargo check` does the job).
This patch also formats the `use` statements in the updated files.
914: Fix bug in getting a Memory from export in C API r=Hywan a=MarkMcCaskey
I believe this fixes the non-deterministic crashing on OSX in `go-ext-wasm`
Co-authored-by: Mark McCaskey <mark@wasmer.io>
856: Add WASI support to C API r=MarkMcCaskey a=MarkMcCaskey
This is an additive change (with one unrelated clean up of `*mut ptr -> *const ptr`). It exposes the functions to get a WASI import object. It also implements a function on import object to get an `import` with namespace and name.
These changes should be okay to ship now, we can follow up to finish adding methods to ImportObject on the C API side and start migrating away from `*imports`.
# Review
- [x] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
Co-authored-by: nlewycky <nick@wasmer.io>