This commit is contained in:
Sergey Pepyakin 2019-07-03 15:01:12 +02:00
parent 9f4cc26c02
commit 518da20b6b
1 changed files with 10 additions and 11 deletions

View File

@ -12,6 +12,16 @@ use parity_wasm::elements::ResizableLimits;
use value::LittleEndianConvert; use value::LittleEndianConvert;
use Error; use Error;
#[cfg(all(unix, not(feature = "vec_memory")))]
#[path = "mmap_bytebuf.rs"]
mod bytebuf;
#[cfg(any(not(unix), feature = "vec_memory"))]
#[path = "vec_bytebuf.rs"]
mod bytebuf;
use self::bytebuf::ByteBuf;
/// Size of a page of [linear memory][`MemoryInstance`] - 64KiB. /// Size of a page of [linear memory][`MemoryInstance`] - 64KiB.
/// ///
/// The size of a memory is always a integer multiple of a page size. /// The size of a memory is always a integer multiple of a page size.
@ -69,16 +79,6 @@ impl fmt::Debug for MemoryInstance {
} }
} }
#[cfg(all(unix, not(feature = "vec_memory")))]
#[path = "mmap_bytebuf.rs"]
mod bytebuf;
#[cfg(any(not(unix), feature = "vec_memory"))]
#[path = "vec_bytebuf.rs"]
mod bytebuf;
use self::bytebuf::ByteBuf;
struct CheckedRegion { struct CheckedRegion {
offset: usize, offset: usize,
size: usize, size: usize,
@ -531,7 +531,6 @@ mod tests {
#[cfg(target_pointer_width = "64")] #[cfg(target_pointer_width = "64")]
fixtures.extend(&[ fixtures.extend(&[
(65536, Some(65536), true), (65536, Some(65536), true),
(65536, Some(0), false), (65536, Some(0), false),
(65536, None, true), (65536, None, true),