From 37514b730f154d1ff48d00d458a42956fa22b3ba Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Wed, 20 May 2020 12:29:00 -0700 Subject: [PATCH] wig: alex has convinced me that this BorrowChecker creation is correct --- crates/wasi-common/wig/src/wasi.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/wasi-common/wig/src/wasi.rs b/crates/wasi-common/wig/src/wasi.rs index 0a0acf60f1..243334c5be 100644 --- a/crates/wasi-common/wig/src/wasi.rs +++ b/crates/wasi-common/wig/src/wasi.rs @@ -468,12 +468,10 @@ pub fn define_struct_for_wiggle(args: TokenStream) -> TokenStream { } }; let mem: WasiMemory = mem.into(); - // FIXME: - // Currently, none of the wasi-common functions will re-enter the guest, so - // creating a BorrowChecker here ensures there is just one per the - // WebAssembly memory. I'd like a wasmtime expert to show me how to - // create a BorrowChecker once per Store, and access it in this - // context, though. + // Wiggle does not expose any methods for functions to re-enter the + // WebAssembly module, or expose the memory via non-wiggle mechanisms. + // Therefore, creating a new BorrowChecker at the root of each function + // invocation is correct. let bc = wiggle::BorrowChecker::new(); wasi_common::wasi::#module_id::#name_ident( &mut my_cx.borrow_mut(),