Set all memory allocated in this `Memory` up to now as readable and executable.
(
&mut self,
branch_protection: BranchProtection,
)
| 94 | |
| 95 | /// Set all memory allocated in this `Memory` up to now as readable and executable. |
| 96 | pub(crate) fn set_readable_and_executable( |
| 97 | &mut self, |
| 98 | branch_protection: BranchProtection, |
| 99 | ) -> ModuleResult<()> { |
| 100 | self.finish_current(); |
| 101 | |
| 102 | for &PtrLen { ptr, len, .. } in self.non_protected_allocations_iter() { |
| 103 | super::set_readable_and_executable(ptr, len, branch_protection)?; |
| 104 | } |
| 105 | |
| 106 | // Flush any in-flight instructions from the pipeline |
| 107 | wasmtime_jit_icache_coherence::pipeline_flush_mt().expect("Failed pipeline flush"); |
| 108 | |
| 109 | self.already_protected = self.allocations.len(); |
| 110 | Ok(()) |
| 111 | } |
| 112 | |
| 113 | /// Set all memory allocated in this `Memory` up to now as readonly. |
| 114 | pub(crate) fn set_readonly(&mut self) -> ModuleResult<()> { |
no test coverage detected