Reformat.

This commit is contained in:
Sergey Pepyakin 2019-01-02 23:14:56 +01:00
parent 1d9ec93ffa
commit 203f95fed2
1 changed files with 13 additions and 13 deletions

View File

@ -184,7 +184,7 @@ impl MemoryInstance {
}
/// 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 {
Bytes(self.buffer.borrow().len())
}
@ -392,9 +392,9 @@ impl MemoryInstance {
let (read_region, write_region) =
self.checked_region_pair(&mut buffer, src_offset, len, dst_offset, len)?;
if dst_offset < self.lowest_used.get() as usize {
self.lowest_used.set(dst_offset as u32);
}
if dst_offset < self.lowest_used.get() as usize {
self.lowest_used.set(dst_offset as u32);
}
unsafe {
::core::ptr::copy(
@ -435,9 +435,9 @@ impl MemoryInstance {
)));
}
if dst_offset < self.lowest_used.get() as usize {
self.lowest_used.set(dst_offset as u32);
}
if dst_offset < self.lowest_used.get() as usize {
self.lowest_used.set(dst_offset as u32);
}
unsafe {
::core::ptr::copy_nonoverlapping(
@ -478,9 +478,9 @@ impl MemoryInstance {
.checked_region(&mut dst_buffer, dst_offset, len)?
.range();
if dst_offset < dst.lowest_used.get() as usize {
dst.lowest_used.set(dst_offset as u32);
}
if dst_offset < dst.lowest_used.get() as usize {
dst.lowest_used.set(dst_offset as u32);
}
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();
if offset < self.lowest_used.get() as usize {
self.lowest_used.set(offset as u32);
}
if offset < self.lowest_used.get() as usize {
self.lowest_used.set(offset as u32);
}
for val in &mut buffer[range] {
*val = new_val