Updated compatibility with latest emscripten

This commit is contained in:
Syrus
2019-07-06 17:15:35 -07:00
parent 336b5459bd
commit 24e7c1b263
3 changed files with 39 additions and 16 deletions

View File

@ -22,11 +22,11 @@ use wasmer_runtime_core::{
};
pub fn call_malloc(ctx: &mut Ctx, size: u32) -> u32 {
get_emscripten_data(ctx).malloc.call(size).unwrap()
get_emscripten_data(ctx).malloc.as_ref().unwrap().call(size).unwrap()
}
pub fn call_malloc_with_cast<T: Copy, Ty>(ctx: &mut Ctx, size: u32) -> WasmPtr<T, Ty> {
WasmPtr::new(get_emscripten_data(ctx).malloc.call(size).unwrap())
WasmPtr::new(get_emscripten_data(ctx).malloc.as_ref().unwrap().call(size).unwrap())
}
pub fn call_memalign(ctx: &mut Ctx, alignment: u32, size: u32) -> u32 {
@ -40,6 +40,8 @@ pub fn call_memalign(ctx: &mut Ctx, alignment: u32, size: u32) -> u32 {
pub fn call_memset(ctx: &mut Ctx, pointer: u32, value: u32, size: u32) -> u32 {
get_emscripten_data(ctx)
.memset
.as_ref()
.unwrap()
.call(pointer, value, size)
.unwrap()
}