Use WasmExternType for VarArgs

This commit is contained in:
Lachlan Sneff
2019-02-01 13:18:43 -08:00
parent 79c4566165
commit 631fc8d124
2 changed files with 37 additions and 28 deletions

View File

@ -1,7 +1,11 @@
use std::mem;
use wasmer_runtime_core::vm::Ctx;
use wasmer_runtime_core::{
vm::Ctx,
types::{Type, WasmExternType},
};
#[repr(transparent)]
#[derive(Copy, Clone)]
pub struct VarArgs {
pub pointer: u32, // assuming 32bit wasm
}
@ -13,3 +17,7 @@ impl VarArgs {
unsafe { (ptr as *const T).read() }
}
}
unsafe impl WasmExternType for VarArgs {
const TYPE: Type = Type::I32;
}