Skip to content

Commit

Permalink
Merge branch 'master' into const-FunctionType
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan authored Dec 14, 2020
2 parents 8c73ec8 + 17752cd commit e33202a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [#1881](https://github.com/wasmerio/wasmer/pull/1881) Added `UnsupportedTarget` error to `CompileError`
* [#1908](https://github.com/wasmerio/wasmer/pull/1908) Implemented `TryFrom<Value<T>>` for `i32`/`u32`/`i64`/`u64`/`f32`/`f64`
* [#1911](https://github.com/wasmerio/wasmer/pull/1911) Generalized signature type in `Function::new` and `Function::new_with_env` to accept owned and reference `FunctionType` as well as array pairs. This allows users to define signatures as constants. Implemented `From<([Type; $N], [Type; $M])>` for `FunctionType` to support this.
* [#1927](https://github.com/wasmerio/wasmer/pull/1927) Added mmap support in `Engine::deserialize_from_file` to speed up artifact loading

### Changed

Expand Down
11 changes: 10 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ edition = "2018"

[dependencies]
wasmer = { path = "../api", version = "1.0.0-beta1", default-features = false }
memmap = "0.7"
hex = "0.4"
thiserror = "1"
blake3 = "0.3"
1 change: 1 addition & 0 deletions lib/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ target-lexicon = { version = "0.11", default-features = false }
# flexbuffers = { path = "../../../flatbuffers/rust/flexbuffers", version = "0.1.0" }
backtrace = "0.3"
rustc-demangle = "0.1"
memmap2 = "0.1.0"
more-asserts = "0.2"
thiserror = "1.0"
serde = { version = "1.0", features = ["derive", "rc"] }
Expand Down
6 changes: 4 additions & 2 deletions lib/engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use crate::tunables::Tunables;
use crate::{Artifact, DeserializeError};
use memmap2::Mmap;
use std::path::Path;
use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
use std::sync::Arc;
Expand Down Expand Up @@ -51,8 +52,9 @@ pub trait Engine {
&self,
file_ref: &Path,
) -> Result<Arc<dyn Artifact>, DeserializeError> {
let bytes = std::fs::read(file_ref)?;
self.deserialize(&bytes)
let file = std::fs::File::open(file_ref)?;
let mmap = Mmap::map(&file)?;
self.deserialize(&mmap)
}

/// A unique identifier for this object.
Expand Down

0 comments on commit e33202a

Please sign in to comment.