MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / set_readable_and_executable

Method set_readable_and_executable

cranelift/jit/src/memory/system.rs:96–111  ·  view source on GitHub ↗

Set all memory allocated in this `Memory` up to now as readable and executable.

(
        &mut self,
        branch_protection: BranchProtection,
    )

Source from the content-addressed store, hash-verified

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<()> {

Callers 1

finalizeMethod · 0.80

Calls 7

OkFunction · 0.85
finish_currentMethod · 0.80
pipeline_flush_mtFunction · 0.50
expectMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected