File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed
crates/wasmi/src/engine/executor/instrs Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,7 @@ impl Executor<'_> {
6767 ' exec : ' bytes ,
6868 ' store : ' bytes ,
6969 {
70- // Safety: the underlying instance of `self.cache` is always kept up-to-date conservatively.
71- let memory = unsafe {
72- self . cache
73- . get_memory ( memory)
74- . unwrap_or_else ( || panic ! ( "missing linear memory for {memory:?}" ) )
75- } ;
70+ let memory = self . get_memory ( memory) ;
7671 store. resolve_memory ( & memory) . data ( )
7772 }
7873
Original file line number Diff line number Diff line change @@ -57,13 +57,15 @@ impl Executor<'_> {
5757 }
5858
5959 /// Fetches the bytes of the default memory at index 0.
60+ #[ inline]
6061 fn fetch_default_memory_bytes_mut ( & mut self ) -> & mut [ u8 ] {
6162 // Safety: the `self.cache.memory` pointer is always synchronized
6263 // conservatively whenever it could have been invalidated.
6364 unsafe { self . cache . memory . data_mut ( ) }
6465 }
6566
6667 /// Fetches the bytes of the given `memory`.
68+ #[ inline]
6769 fn fetch_memory_bytes_mut < ' exec , ' store , ' bytes > (
6870 & ' exec mut self ,
6971 memory : Memory ,
@@ -81,6 +83,7 @@ impl Executor<'_> {
8183
8284 /// Fetches the bytes of the given non-default `memory`.
8385 #[ cold]
86+ #[ inline]
8487 fn fetch_non_default_memory_bytes_mut < ' exec , ' store , ' bytes > (
8588 & ' exec mut self ,
8689 memory : Memory ,
@@ -90,12 +93,7 @@ impl Executor<'_> {
9093 ' exec : ' bytes ,
9194 ' store : ' bytes ,
9295 {
93- // Safety: the underlying instance of `self.cache` is always kept up-to-date conservatively.
94- let memory = unsafe {
95- self . cache
96- . get_memory ( memory)
97- . unwrap_or_else ( || panic ! ( "missing linear memory for {memory:?}" ) )
98- } ;
96+ let memory = self . get_memory ( memory) ;
9997 store. resolve_memory_mut ( & memory) . data_mut ( )
10098 }
10199
You can’t perform that action at this time.
0 commit comments