Merge remote-tracking branch 'origin/main' into pch/wiggle_sync_shimming
This commit is contained in:
@@ -176,8 +176,3 @@ pub extern "C" fn wasmtime_config_static_memory_guard_size_set(c: &mut wasm_conf
|
||||
pub extern "C" fn wasmtime_config_dynamic_memory_guard_size_set(c: &mut wasm_config_t, size: u64) {
|
||||
c.config.dynamic_memory_guard_size(size);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wasmtime_config_max_instances_set(c: &mut wasm_config_t, limit: usize) {
|
||||
c.config.max_instances(limit);
|
||||
}
|
||||
|
||||
@@ -31,13 +31,13 @@ impl wasm_memory_t {
|
||||
pub extern "C" fn wasm_memory_new(
|
||||
store: &wasm_store_t,
|
||||
mt: &wasm_memorytype_t,
|
||||
) -> Box<wasm_memory_t> {
|
||||
let memory = Memory::new(&store.store, mt.ty().ty.clone());
|
||||
Box::new(wasm_memory_t {
|
||||
) -> Option<Box<wasm_memory_t>> {
|
||||
let memory = Memory::new(&store.store, mt.ty().ty.clone()).ok()?;
|
||||
Some(Box::new(wasm_memory_t {
|
||||
ext: wasm_extern_t {
|
||||
which: memory.into(),
|
||||
},
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
@@ -185,10 +185,13 @@ pub extern "C" fn wasmtime_module_deserialize(
|
||||
binary: &wasm_byte_vec_t,
|
||||
ret: &mut *mut wasm_module_t,
|
||||
) -> Option<Box<wasmtime_error_t>> {
|
||||
handle_result(Module::new(&engine.engine, binary.as_slice()), |module| {
|
||||
let module = Box::new(wasm_module_t::new(module));
|
||||
*ret = Box::into_raw(module);
|
||||
})
|
||||
handle_result(
|
||||
unsafe { Module::deserialize(&engine.engine, binary.as_slice()) },
|
||||
|module| {
|
||||
let module = Box::new(wasm_module_t::new(module));
|
||||
*ret = Box::into_raw(module);
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user