mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 21:58:20 +00:00
Apply suggestions from code review
Co-authored-by: nlewycky <nick@wasmer.io>
This commit is contained in:
2
lib/cache/src/filesystem.rs
vendored
2
lib/cache/src/filesystem.rs
vendored
@@ -70,7 +70,7 @@ impl FileSystemCache {
|
|||||||
/// Set the extension for this cached file.
|
/// Set the extension for this cached file.
|
||||||
///
|
///
|
||||||
/// This is needed for loading native files from Windows, as otherwise
|
/// This is needed for loading native files from Windows, as otherwise
|
||||||
/// loadding the library will fail (it requires to have a `.dll` extension)
|
/// loading the library will fail (it requires a `.dll` extension)
|
||||||
pub fn set_cache_extension(&mut self, ext: Option<impl ToString>) {
|
pub fn set_cache_extension(&mut self, ext: Option<impl ToString>) {
|
||||||
self.ext = ext.map(|ext| ext.to_string());
|
self.ext = ext.map(|ext| ext.to_string());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ systems where fast and consistent compilation times are very critical.
|
|||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
At the moment, this crate depends on Rust nightly to be compiled, as it uses
|
At the moment, this crate depends on Rust nightly to be compiled, as it uses
|
||||||
`dynasm-rs` which can only be compiled in Nigthly.
|
`dynasm-rs` which can only be compiled in Nightly.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Code (PIC).
|
|||||||
|
|
||||||
After the compiler generates the machine code for the functions, the
|
After the compiler generates the machine code for the functions, the
|
||||||
Native Engine generates a shared object file and links it via `dlsym`
|
Native Engine generates a shared object file and links it via `dlsym`
|
||||||
so it can be usable by the `wasmer` api.
|
so it can be usable by the `wasmer` API.
|
||||||
|
|
||||||
This allows Wasmer to achieve *blazing fast* native startup times.
|
This allows Wasmer to achieve *blazing fast* native startup times.
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ This allows Wasmer to achieve *blazing fast* native startup times.
|
|||||||
The `wasmer-engine-native` crate requires a linker available on your
|
The `wasmer-engine-native` crate requires a linker available on your
|
||||||
system to generate the shared object file.
|
system to generate the shared object file.
|
||||||
|
|
||||||
We recommend having installed `gcc` or `clang`.
|
We recommend having `gcc` or `clang` installed.
|
||||||
|
|
||||||
> Note: when cross-compiling to other targets, `clang` will be the
|
> Note: when cross-compiling to other targets, `clang` will be the
|
||||||
> default command used for compiling.
|
> default command used for compiling.
|
||||||
|
|||||||
@@ -65,9 +65,9 @@ impl NativeArtifact {
|
|||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
const MAGIC_HEADER_ELF_64: &'static [u8] = &[0x7f, b'E', b'L', b'F', 2];
|
const MAGIC_HEADER_ELF_64: &'static [u8] = &[0x7f, b'E', b'L', b'F', 2];
|
||||||
|
|
||||||
// Coff Magic heaer for Windows (64 bit)
|
// COFF Magic header for Windows (64 bit)
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
const MAGIC_HEADER_COFF_64: &'static [u8] = &[0x4d, 0x5a];
|
const MAGIC_HEADER_COFF_64: &'static [u8] = &[b'M', b'Z'];
|
||||||
|
|
||||||
/// Check if the provided bytes look like `NativeArtifact`.
|
/// Check if the provided bytes look like `NativeArtifact`.
|
||||||
///
|
///
|
||||||
@@ -186,7 +186,7 @@ impl NativeArtifact {
|
|||||||
Ok(Endianness::Big) => object::Endianness::Big,
|
Ok(Endianness::Big) => object::Endianness::Big,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
return Err(CompileError::Codegen(format!(
|
return Err(CompileError::Codegen(format!(
|
||||||
"Can't detect the endianess for the target: {:?}",
|
"Can't detect the endianness for the target: {:?}",
|
||||||
e
|
e
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user