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

Method write_bytes

crates/wasmtime/src/compile/runtime.rs:239–247  ·  view source on GitHub ↗
(&mut self, val: &[u8])

Source from the content-addressed store, hash-verified

237 }
238
239 fn write_bytes(&mut self, val: &[u8]) {
240 let mmap = self.mmap.as_mut().expect("write before reserve");
241 // SAFETY: the `mmap` has not be made readonly yet so it should
242 // be safe to mutate it.
243 unsafe {
244 mmap.as_mut_slice()[self.len..][..val.len()].copy_from_slice(val);
245 }
246 self.len += val.len();
247 }
248 }
249 }
250}

Callers 2

linear_lower_to_flatMethod · 0.45
memory_fillFunction · 0.45

Calls 5

expectMethod · 0.45
as_mutMethod · 0.45
copy_from_sliceMethod · 0.45
as_mut_sliceMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected