mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-25 06:31:32 +00:00
Update to new runtime
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use std::mem;
|
||||
use wasmer_runtime_core::Instance;
|
||||
use wasmer_runtime_core::vm::Ctx;
|
||||
|
||||
#[repr(transparent)]
|
||||
pub struct VarArgs {
|
||||
@ -7,8 +7,8 @@ pub struct VarArgs {
|
||||
}
|
||||
|
||||
impl VarArgs {
|
||||
pub fn get<T: Sized>(&mut self, instance: &mut Instance) -> T {
|
||||
let ptr = instance.memory_offset_addr(0, self.pointer as usize);
|
||||
pub fn get<T: Sized>(&mut self, vmctx: &mut Ctx) -> T {
|
||||
let ptr = vmctx.memory(0)[self.pointer as usize];
|
||||
self.pointer += mem::size_of::<T>() as u32;
|
||||
unsafe { (ptr as *const T).read() }
|
||||
}
|
||||
|
Reference in New Issue
Block a user