From ee26b9ead7b697b596175d9e88ec785bd76e8e4e Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Mon, 9 Sep 2019 16:52:44 -0500 Subject: [PATCH] few comments. --- wasmtime-api/src/instance.rs | 3 ++- wasmtime-api/src/runtime.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wasmtime-api/src/instance.rs b/wasmtime-api/src/instance.rs index 98e4d34c75..214f30e2aa 100644 --- a/wasmtime-api/src/instance.rs +++ b/wasmtime-api/src/instance.rs @@ -110,7 +110,8 @@ impl Instance { let export = mutable.lookup(name).expect("export"); if let wasmtime_runtime::Export::Function { signature, .. } = &export { // HACK ensure all handles, instantiated outside Store, present in - // the store's SignatureRegistry. + // the store's SignatureRegistry, e.g. WASI instances that are + // imported into this store using the from_handle() method. use crate::runtime::SignatureRegistry; let _ = store.borrow_mut().register_cranelift_signature(signature); } diff --git a/wasmtime-api/src/runtime.rs b/wasmtime-api/src/runtime.rs index 4e43a11cdf..4d136e9083 100644 --- a/wasmtime-api/src/runtime.rs +++ b/wasmtime-api/src/runtime.rs @@ -79,6 +79,9 @@ impl Engine { // Store +/// The SignatureRegistry allow register new cranelift signature, +/// and also quickly retrive the signature back using registration +/// index. pub(crate) trait SignatureRegistry { fn register_cranelift_signature( &mut self,