parent
e047f508fa
commit
d52ba8849a
|
@ -22,7 +22,9 @@ env:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then rustup target add wasm32-unknown-unknown; fi
|
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then rustup target add wasm32-unknown-unknown; fi
|
||||||
|
- rustup component add rustfmt
|
||||||
script:
|
script:
|
||||||
|
- cargo fmt --all -- --check
|
||||||
# Make sure nightly targets are not broken.
|
# Make sure nightly targets are not broken.
|
||||||
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo check --tests --manifest-path=fuzz/Cargo.toml; fi
|
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo check --tests --manifest-path=fuzz/Cargo.toml; fi
|
||||||
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo check --benches --manifest-path=benches/Cargo.toml; fi
|
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then cargo check --benches --manifest-path=benches/Cargo.toml; fi
|
||||||
|
|
|
@ -184,7 +184,7 @@ impl MemoryInstance {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns current used memory size in bytes.
|
/// Returns current used memory size in bytes.
|
||||||
/// This is the highest memory address that had been written to.
|
/// This is the highest memory address that had been written to.
|
||||||
pub fn used_size(&self) -> Bytes {
|
pub fn used_size(&self) -> Bytes {
|
||||||
Bytes(self.buffer.borrow().len())
|
Bytes(self.buffer.borrow().len())
|
||||||
}
|
}
|
||||||
|
@ -392,9 +392,9 @@ impl MemoryInstance {
|
||||||
let (read_region, write_region) =
|
let (read_region, write_region) =
|
||||||
self.checked_region_pair(&mut buffer, src_offset, len, dst_offset, len)?;
|
self.checked_region_pair(&mut buffer, src_offset, len, dst_offset, len)?;
|
||||||
|
|
||||||
if dst_offset < self.lowest_used.get() as usize {
|
if dst_offset < self.lowest_used.get() as usize {
|
||||||
self.lowest_used.set(dst_offset as u32);
|
self.lowest_used.set(dst_offset as u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
::core::ptr::copy(
|
::core::ptr::copy(
|
||||||
|
@ -435,9 +435,9 @@ impl MemoryInstance {
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if dst_offset < self.lowest_used.get() as usize {
|
if dst_offset < self.lowest_used.get() as usize {
|
||||||
self.lowest_used.set(dst_offset as u32);
|
self.lowest_used.set(dst_offset as u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
::core::ptr::copy_nonoverlapping(
|
::core::ptr::copy_nonoverlapping(
|
||||||
|
@ -478,9 +478,9 @@ impl MemoryInstance {
|
||||||
.checked_region(&mut dst_buffer, dst_offset, len)?
|
.checked_region(&mut dst_buffer, dst_offset, len)?
|
||||||
.range();
|
.range();
|
||||||
|
|
||||||
if dst_offset < dst.lowest_used.get() as usize {
|
if dst_offset < dst.lowest_used.get() as usize {
|
||||||
dst.lowest_used.set(dst_offset as u32);
|
dst.lowest_used.set(dst_offset as u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
dst_buffer[dst_range].copy_from_slice(&src_buffer[src_range]);
|
dst_buffer[dst_range].copy_from_slice(&src_buffer[src_range]);
|
||||||
|
|
||||||
|
@ -499,9 +499,9 @@ impl MemoryInstance {
|
||||||
|
|
||||||
let range = self.checked_region(&mut buffer, offset, len)?.range();
|
let range = self.checked_region(&mut buffer, offset, len)?.range();
|
||||||
|
|
||||||
if offset < self.lowest_used.get() as usize {
|
if offset < self.lowest_used.get() as usize {
|
||||||
self.lowest_used.set(offset as u32);
|
self.lowest_used.set(offset as u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
for val in &mut buffer[range] {
|
for val in &mut buffer[range] {
|
||||||
*val = new_val
|
*val = new_val
|
||||||
|
|
Loading…
Reference in New Issue