This adds a `--always-lightbeam` option as well as an `--always-cranelift`
option, to allow the compilation strategy to be selected via the
command-line. This also enables regular testing for Lightbeam.
This fixes the memory leaks in the following functions which should not be
returning "owned" pointers:
* `wasm_extern_as_func`
* `wasm_func_as_extern`
* `wasm_extern_as_global`
* `wasm_global_as_extern`
* `wasm_extern_as_memory`
* `wasm_extern_as_table`
Additionally, this commit implements the `wasm_memory_as_extern` and
`wasm_table_as_extern` functions.
Fixes#394.
In trying to build the lightbeam feature in wasmtime there are
compile errors mostly related to outdated or missing trait
definitions. This patch moves the current cranelift codegen
dependence to 0.44 in support of that, though other changes
are still needed in wasmtime to get the feature to build.
* Begin sketching out a new high-level `fs` API.
This is a very preliminary sketch of #83. It doesn't even compile yet,
but it shows a possible high-level structure of such an API.
* Stub out more functionality.
* Switch from a lazy_static WasiCtx to a borrowed one.
* Reformat some comments.
* Code-quote `Self`.
* Implement error translation for Windows.
* Calls to `fd_close` are now unsafe.
* Implement a few more functions.
* Open /dev/null for writing as well as reading.
Port this fix to wasi-common:
b905c44483
* Remove all remaining uses of `std::mem::uninitialized`.
Patch inspired by:
2d6519d051
* Replace libc::memcpy() calls with std::ptr::copy_nonoverlapping()
Port this fix to wasi-common:
a3f3a33e9b
* Pass `WasiError` by value.
It's a `u16` underneath, so we can pass it by value.
* Avoid unnecessary explicit lifetime parameters.
* Use immutable references rather than mutable references.
Patch inspired by:
54baa4c38c
With 92a19e9398 the optimisation levels of cranelift were renamed, without this change trying to use the -o flag on wasmtime runtime results in "error: Unexpected value for a setting, expected any among none, speed, speed_and_size".
"best" was renamed "speed_and_size", although I think "speed" is more adapted to wastime.
Bye,
JB.
This commit implements populating the table imports of a module from the API.
It also allows for `anyref` in table types as per the reference types proposal.
This PR fixes the borrow scope of store in the `WrappedCallable` impl of
`WasmTimeFn` such that it does not remain borrowed across the call to
`wasmtime_call_trampoline`. By limiting the scope of the borrow, the
implementation can be reentered if an exported function calls an imported
function, which in turn calls another exported function.
Fixes#365.
The fix contains an errno remapping in macOS case where in case
when we try to rename a file into a path with a trailing slash an
ENOENT is returned. In this case, if the destination does not exist,
an ENOTDIR should be thrown as is thrown correctly on Linux hosts.
Thus, as a fix, if an ENOENT is thrown, an additional check is
performed to see whether the destination path indeed contains
a trailing slash, and if so, the errno is adjusted to ENOTDIR
to match the POSIX/WASI spec.