clz/ctz/popcnt

This commit is contained in:
Jef
2019-01-17 13:51:18 +01:00
parent 74d168ec4b
commit e0f032a0e5
4 changed files with 141 additions and 22 deletions

View File

@@ -131,10 +131,9 @@ impl TranslatedModule {
});
let mem_size = self.memory.map(|m| m.limits.initial).unwrap_or(0) as usize;
let layout = Layout::new::<VmCtx>()
let (layout, _mem_offset) = Layout::new::<VmCtx>()
.extend(Layout::array::<u8>(mem_size * WASM_PAGE_SIZE).unwrap())
.unwrap()
.0;
.unwrap();
let ptr = unsafe { alloc::alloc_zeroed(layout) } as *mut VmCtx;