Debugging for store

This commit is contained in:
Sergey Pepyakin
2017-12-12 18:18:08 +01:00
parent 0bbd55cf21
commit 2cfb0a6159
3 changed files with 38 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
use std::u32;
use std::ops::Range;
use std::cmp;
use std::fmt;
use parking_lot::RwLock;
use elements::{MemoryType, ResizableLimits};
use interpreter::Error;
@@ -21,6 +22,16 @@ pub struct MemoryInstance {
maximum_size: u32,
}
impl fmt::Debug for MemoryInstance {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("MemoryInstance")
.field("limits", &self.limits)
.field("buffer.len", &self.buffer.read().len())
.field("maximum_size", &self.maximum_size)
.finish()
}
}
struct CheckedRegion<'a, B: 'a> where B: ::std::ops::Deref<Target=Vec<u8>> {
buffer: &'a B,
offset: usize,