(
#[cfg(feature = "gc")] mut store: wasmtime::RootScope<WasmtimeStoreContextMut<'_>>,
#[cfg(not(feature = "gc"))] mut store: WasmtimeStoreContextMut<'_>,
func: &Func,
args: impl ExactS
| 221 | } |
| 222 | |
| 223 | async fn do_func_call_async( |
| 224 | #[cfg(feature = "gc")] mut store: wasmtime::RootScope<WasmtimeStoreContextMut<'_>>, |
| 225 | #[cfg(not(feature = "gc"))] mut store: WasmtimeStoreContextMut<'_>, |
| 226 | func: &Func, |
| 227 | args: impl ExactSizeIterator<Item = Val>, |
| 228 | results: &mut [MaybeUninit<wasmtime_val_t>], |
| 229 | trap_ret: &mut *mut wasm_trap_t, |
| 230 | err_ret: &mut *mut wasmtime_error_t, |
| 231 | ) { |
| 232 | let mut params = mem::take(&mut store.as_context_mut().data_mut().wasm_val_storage); |
| 233 | let (wt_params, wt_results) = translate_args(&mut params, args, results.len()); |
| 234 | let result = func.call_async(&mut store, wt_params, wt_results).await; |
| 235 | |
| 236 | match result { |
| 237 | Ok(()) => { |
| 238 | for (slot, val) in results.iter_mut().zip(wt_results.iter()) { |
| 239 | crate::initialize(slot, wasmtime_val_t::from_val(&mut store, *val)); |
| 240 | } |
| 241 | params.truncate(0); |
| 242 | store.as_context_mut().data_mut().wasm_val_storage = params; |
| 243 | } |
| 244 | Err(err) => handle_call_error(err, trap_ret, err_ret), |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | #[unsafe(no_mangle)] |
| 249 | pub unsafe extern "C" fn wasmtime_func_call_async<'a>( |
no test coverage detected