mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-19 03:41:22 +00:00
Merge branch 'master' into fix-runtime-c-api-header-preprocessor-clang
This commit is contained in:
@ -5,6 +5,8 @@ description = "Wasmer runtime Cranelift compiler backend"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
keywords = ["wasm", "webassembly", "compiler", "JIT", "AOT"]
|
||||
categories = ["wasm"]
|
||||
edition = "2018"
|
||||
readme = "README.md"
|
||||
|
||||
|
@ -5,6 +5,8 @@ description = "Wasmer runtime emscripten implementation library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
keywords = ["wasm", "webassembly", "ABI", "emscripten", "posix"]
|
||||
categories = ["wasm"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
|
@ -1,7 +1,11 @@
|
||||
[package]
|
||||
name = "wasmer-llvm-backend"
|
||||
version = "0.10.1"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
keywords = ["wasm", "webassembly", "compiler", "JIT", "llvm"]
|
||||
categories = ["wasm"]
|
||||
edition = "2018"
|
||||
readme = "README.md"
|
||||
|
||||
|
@ -5,6 +5,8 @@ repository = "https://github.com/wasmerio/wasmer"
|
||||
description = "Wasmer runtime common middlewares"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
keywords = ["wasm", "webassembly", "middleware", "metering"]
|
||||
categories = ["wasm"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
|
@ -5,6 +5,8 @@ description = "Wasmer C API library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
keywords = ["wasm", "webassembly", "runtime"]
|
||||
categories = ["wasm"]
|
||||
edition = "2018"
|
||||
readme = "README.md"
|
||||
|
||||
|
@ -5,6 +5,8 @@ description = "Wasmer runtime core library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
keywords = ["wasm", "webassembly", "runtime"]
|
||||
categories = ["wasm"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
|
@ -45,9 +45,47 @@ macro_rules! trace {
|
||||
}
|
||||
|
||||
/// Helper macro to create a new `Func` object using the provided function pointer.
|
||||
///
|
||||
/// # Usage
|
||||
///
|
||||
/// Function pointers or closures are supported. Closures can capture
|
||||
/// their environment (with `move). The first parameter is likely to
|
||||
/// be of kind `vm::Ctx`, though it can be optional.
|
||||
///
|
||||
/// ```
|
||||
/// # use wasmer_runtime_core::{imports, func};
|
||||
/// # use wasmer_runtime_core::vm;
|
||||
///
|
||||
/// // A function that has access to `vm::Ctx`.
|
||||
/// fn func_with_vmctx(_: &mut vm::Ctx, n: i32) -> i32 {
|
||||
/// n
|
||||
/// }
|
||||
///
|
||||
/// // A function that cannot access `vm::Ctx`.
|
||||
/// fn func(n: i32) -> i32 {
|
||||
/// n
|
||||
/// }
|
||||
///
|
||||
/// let i = 7;
|
||||
///
|
||||
/// let import_object = imports! {
|
||||
/// "env" => {
|
||||
/// "foo" => func!(func_with_vmctx),
|
||||
/// "bar" => func!(func),
|
||||
/// // A closure with a captured environment, and an access to `vm::Ctx`.
|
||||
/// "baz" => func!(move |_: &mut vm::Ctx, n: i32| -> i32 {
|
||||
/// n + i
|
||||
/// }),
|
||||
/// // A closure without a captured environment, and no access to `vm::Ctx`.
|
||||
/// "qux" => func!(|n: i32| -> i32 {
|
||||
/// n
|
||||
/// }),
|
||||
/// },
|
||||
/// };
|
||||
/// ```
|
||||
#[macro_export]
|
||||
macro_rules! func {
|
||||
($func:path) => {{
|
||||
($func:expr) => {{
|
||||
$crate::Func::new($func)
|
||||
}};
|
||||
}
|
||||
@ -56,12 +94,12 @@ macro_rules! func {
|
||||
///
|
||||
/// [`ImportObject`]: struct.ImportObject.html
|
||||
///
|
||||
/// # Note:
|
||||
/// # Note
|
||||
/// The `import` macro currently only supports
|
||||
/// importing functions.
|
||||
///
|
||||
///
|
||||
/// # Usage:
|
||||
/// # Usage
|
||||
/// ```
|
||||
/// # use wasmer_runtime_core::{imports, func};
|
||||
/// # use wasmer_runtime_core::vm::Ctx;
|
||||
|
@ -5,6 +5,8 @@ description = "Wasmer runtime library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
keywords = ["wasm", "webassembly", "runtime", "sandbox", "secure"]
|
||||
categories = ["wasm", "api-bindings"]
|
||||
edition = "2018"
|
||||
readme = "README.md"
|
||||
|
||||
|
@ -5,6 +5,8 @@ repository = "https://github.com/wasmerio/wasmer"
|
||||
description = "Wasmer runtime single pass compiler backend"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
keywords = ["wasm", "webassembly", "compiler", "JIT", "AOT"]
|
||||
categories = ["wasm"]
|
||||
edition = "2018"
|
||||
readme = "README.md"
|
||||
|
||||
|
@ -5,6 +5,8 @@ description = "Wasmer runtime WASI implementation library"
|
||||
license = "MIT"
|
||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||
repository = "https://github.com/wasmerio/wasmer"
|
||||
keywords = ["wasm", "webassembly", "wasi", "sandbox", "ABI"]
|
||||
categories = ["wasm"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
|
Reference in New Issue
Block a user