(path: &Path)
| 298 | |
| 299 | impl MappedModule { |
| 300 | fn open(path: &Path) -> Result<Self> { |
| 301 | let file = std::fs::File::open(path)?; |
| 302 | // SAFETY: read-only mapping. Replacing the path (the case checked |
| 303 | // here) creates a new inode and leaves these bytes untouched. Assumes |
| 304 | // modules are not modified or truncated in place while the runner |
| 305 | // post-processes, as the walltime unwind data extraction already does. |
| 306 | let mmap = unsafe { memmap2::Mmap::map(&file)? }; |
| 307 | let identity = Self::mapped_identity(&mmap)?; |
| 308 | Ok(Self { mmap, identity }) |
| 309 | } |
| 310 | |
| 311 | fn mapped_identity(mmap: &memmap2::Mmap) -> Result<(u64, u64)> { |
| 312 | let start = format!("{:x}-", mmap.as_ptr() as usize); |
nothing calls this directly
no outgoing calls
no test coverage detected