Don't store Arc<VMInterrupts> in instances
Similar to other data structures owned by the `Store` there's no need for `Instance` to have a strong `Arc` reference, instead it's sufficient for `Store` to have the owning reference.
This commit is contained in:
@@ -22,7 +22,7 @@ fn instantiate(
|
||||
imports,
|
||||
&mut store.signatures_mut(),
|
||||
config.memory_creator.as_ref().map(|a| a as _),
|
||||
store.interrupts().clone(),
|
||||
store.interrupts(),
|
||||
host,
|
||||
store.externref_activations_table() as *const VMExternRefActivationsTable as *mut _,
|
||||
store.stack_map_registry() as *const StackMapRegistry as *mut _,
|
||||
|
||||
@@ -1030,7 +1030,7 @@ impl Store {
|
||||
self.inner.signal_handler.borrow_mut()
|
||||
}
|
||||
|
||||
pub(crate) fn interrupts(&self) -> &Arc<VMInterrupts> {
|
||||
pub(crate) fn interrupts(&self) -> &VMInterrupts {
|
||||
&self.inner.interrupts
|
||||
}
|
||||
|
||||
@@ -1128,7 +1128,7 @@ impl Store {
|
||||
pub fn interrupt_handle(&self) -> Result<InterruptHandle> {
|
||||
if self.engine().config().tunables.interruptable {
|
||||
Ok(InterruptHandle {
|
||||
interrupts: self.interrupts().clone(),
|
||||
interrupts: self.inner.interrupts.clone(),
|
||||
})
|
||||
} else {
|
||||
bail!("interrupts aren't enabled for this `Store`")
|
||||
|
||||
@@ -42,7 +42,7 @@ pub(crate) fn create_handle(
|
||||
store.memory_creator(),
|
||||
signatures.into_boxed_slice(),
|
||||
state,
|
||||
store.interrupts().clone(),
|
||||
store.interrupts(),
|
||||
store.externref_activations_table() as *const VMExternRefActivationsTable as *mut _,
|
||||
store.stack_map_registry() as *const StackMapRegistry as *mut _,
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user