mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-21 19:51:32 +00:00
public api and example update
This commit is contained in:
parent
d981bf4803
commit
c03f2709cd
@ -2,7 +2,7 @@ extern crate parity_wasm;
|
||||
|
||||
use std::env::args;
|
||||
|
||||
use parity_wasm::ModuleInstanceInterface;
|
||||
use parity_wasm::{interpreter, ModuleInstanceInterface};
|
||||
|
||||
fn main() {
|
||||
let args: Vec<_> = args().collect();
|
||||
@ -12,7 +12,13 @@ fn main() {
|
||||
return;
|
||||
}
|
||||
|
||||
let program = parity_wasm::ProgramInstance::new().expect("Failed to load program");
|
||||
let program = parity_wasm::ProgramInstance::with_env_params(
|
||||
interpreter::EnvParams {
|
||||
total_stack: 128*1024,
|
||||
total_memory: 2*1024*1024,
|
||||
allow_memory_growth: false,
|
||||
}
|
||||
).expect("Failed to load program");
|
||||
let module = parity_wasm::deserialize_file(&args[1]).expect("Failed to load module");
|
||||
let module = program.add_module("main", module).expect("Failed to initialize module");
|
||||
let argument: i32 = args[2].parse().expect("Integer argument required");
|
||||
|
@ -76,3 +76,4 @@ pub use self::program::ProgramInstance;
|
||||
pub use self::value::RuntimeValue;
|
||||
pub use self::variable::VariableInstance;
|
||||
pub use self::env_native::{env_native_module, UserFunctions, UserFunction, UserFunctionExecutor};
|
||||
pub use self::env::EnvParams;
|
Loading…
x
Reference in New Issue
Block a user