Update dependencies.

This commit is contained in:
Dan Gohman
2019-10-02 11:00:28 -07:00
parent 8d52e389f8
commit 8c524815c3
2 changed files with 11 additions and 7 deletions

View File

@@ -217,19 +217,21 @@ impl<T> Drop for BoxSlice<T> {
}
}
type BoxByteSlice = BoxSlice<u8>;
pub struct VmCtx {
mem: BoxSlice<u8>,
mem: BoxByteSlice,
}
impl VmCtx {
pub fn offset_of_memory_ptr() -> u32 {
offset_of!(VmCtx, mem.ptr)
(offset_of!(VmCtx, mem) + offset_of!(BoxByteSlice, ptr))
.try_into()
.expect("Offset exceeded size of u32")
}
pub fn offset_of_memory_len() -> u32 {
offset_of!(VmCtx, mem.len)
(offset_of!(VmCtx, mem) + offset_of!(BoxByteSlice, len))
.try_into()
.expect("Offset exceeded size of u32")
}