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

Method maybe_atomic_write_all

crates/jit-debug/src/perf_jitdump.rs:239–242  ·  view source on GitHub ↗

Helper function to write `bytes` to the jitdump file. This is effectively a workaround for the limitation of the jitdump file format. Ideally Wasmtime would be writing to its own personal file and wouldn't have to worry about concurrent modifications, but we don't have the luxury of doing that. The jitdump file format requires that there's a single file-per-process with records in it. Additionall

(&self, bytes: &[u8])

Source from the content-addressed store, hash-verified

237 /// lieu of some actual synchronization protocol between engines though this
238 /// is about the best that we can do.
239 fn maybe_atomic_write_all(&self, bytes: &[u8]) -> io::Result<()> {
240 (&self.jitdump_file).write_all(bytes)?;
241 Ok(())
242 }
243
244 fn maybe_write_file_header(&self) -> io::Result<()> {
245 let header = FileHeader {

Callers 2

dump_code_load_recordMethod · 0.80

Calls 2

OkFunction · 0.85
write_allMethod · 0.80

Tested by

no test coverage detected