Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching Frank functions #863

Merged
merged 17 commits into from
Oct 7, 2019
Prev Previous commit
improve comments
mikevoronov committed Oct 7, 2019
commit a530009fd7820c2f48f25c97e33f926cc53cc127
8 changes: 4 additions & 4 deletions vm/frank/src/vm/frank.rs
Original file line number Diff line number Diff line change
@@ -30,9 +30,9 @@ use wasmer_runtime_core::memory::ptr::{Array, WasmPtr};
pub struct Frank {
instance: &'static Instance,

// it is safe to use unwrap() while calling these functions because Option is used here
// just to allow partially initialization of the struct. And all Option fields will
// really contain Some after invoking Frank::new.
// It is safe to use unwrap() while calling these functions because Option is used here
// to allow partially initialization of the struct. And all Option fields will contain
// Some if invoking Frank::new is succeed.
allocate: Option<Func<'static, i32, i32>>,
deallocate: Option<Func<'static, (i32, i32), ()>>,
invoke: Option<Func<'static, (i32, i32), i32>>,
@@ -41,7 +41,7 @@ pub struct Frank {
}

impl Drop for Frank {
// In normal situation this method should be called only while shutting down
// In normal situation this method should be called only while VM shutting down.
fn drop(&mut self) {
drop(self.allocate.as_ref());
drop(self.deallocate.as_ref());