MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / write_str

Function write_str

src/monitor.rs:101–106  ·  view source on GitHub ↗
(mmap: &mut memmap2::MmapMut, offset: usize, value: &str)

Source from the content-addressed store, hash-verified

99}
100
101fn write_str(mmap: &mut memmap2::MmapMut, offset: usize, value: &str) {
102 let bytes = value.as_bytes();
103 let copy_len = bytes.len().min(FIELD_LEN - 1);
104 mmap[offset..offset + FIELD_LEN].fill(0);
105 mmap[offset..offset + copy_len].copy_from_slice(&bytes[..copy_len]);
106}
107
108fn write_entry_inner(
109 mmap_path: &Path,

Callers 1

write_entry_innerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected