mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-05-10 22:17:13 +00:00
Externalize mem ops
This commit is contained in:
parent
867a97ba1a
commit
023fe5e8cb
@ -71,8 +71,8 @@ fn main() {
|
|||||||
.arg(Arg::with_name("skip_optimization")
|
.arg(Arg::with_name("skip_optimization")
|
||||||
.help("Skip symbol optimization step producing final wasm")
|
.help("Skip symbol optimization step producing final wasm")
|
||||||
.long("skip-optimization"))
|
.long("skip-optimization"))
|
||||||
.arg(Arg::with_name("skip_alloc")
|
.arg(Arg::with_name("skip_externalize")
|
||||||
.help("Skip allocator externalizer step producing final wasm")
|
.help("Skip externalizer step producing final wasm")
|
||||||
.long("skip-externalize"))
|
.long("skip-externalize"))
|
||||||
.arg(Arg::with_name("runtime_type")
|
.arg(Arg::with_name("runtime_type")
|
||||||
.help("Injects RUNTIME_TYPE global export")
|
.help("Injects RUNTIME_TYPE global export")
|
||||||
@ -93,10 +93,10 @@ fn main() {
|
|||||||
|
|
||||||
let mut module = parity_wasm::deserialize_file(&path).unwrap();
|
let mut module = parity_wasm::deserialize_file(&path).unwrap();
|
||||||
|
|
||||||
if !matches.is_present("skip_alloc") {
|
if !matches.is_present("skip_externalize") {
|
||||||
module = wasm_utils::externalize(
|
module = wasm_utils::externalize(
|
||||||
module,
|
module,
|
||||||
vec!["_free", "_malloc"],
|
vec!["_free", "_malloc", "_memcpy", "_memset", "_memmove"],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let module = wasm_utils::externalize(
|
let module = wasm_utils::externalize(
|
||||||
parity_wasm::deserialize_file(&args[1]).expect("Module to deserialize ok"),
|
parity_wasm::deserialize_file(&args[1]).expect("Module to deserialize ok"),
|
||||||
vec!["_free", "_malloc"],
|
vec!["_free", "_malloc", "_memcpy", "_memset", "_memmove"],
|
||||||
);
|
);
|
||||||
|
|
||||||
parity_wasm::serialize_to_file(&args[2], module).expect("Module to serialize ok");
|
parity_wasm::serialize_to_file(&args[2], module).expect("Module to serialize ok");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user