Function vm_memory::mmap::check_file_offset
source ยท pub fn check_file_offset(
file_offset: &FileOffset,
size: usize,
) -> Result<(), MmapRegionError>
Expand description
Checks if a mapping of size
bytes fits at the provided file_offset
.
For a borrowed FileOffset
and size, this function checks whether the mapping does not
extend past EOF, and that adding the size to the file offset does not lead to overflow.