Memory mapped files are a mechanism in operating systems that allows
file access through virtual memory. After opening a file with MmFile,
the contents can be read from or written to with standard slice / pointer operations.
Changes to the memory are automatically reflected in the underlying file.
Memory mapping can increase I/O performance of large files, compared to buffered
read / write operations from std.file and std.stdio. However, I/O errors are
not handled as safely: when for example the disk that the file is on gets removed,
reading from it may result in a segfault.
Read and write memory mapped files.
Memory mapped files are a mechanism in operating systems that allows file access through virtual memory. After opening a file with MmFile, the contents can be read from or written to with standard slice / pointer operations. Changes to the memory are automatically reflected in the underlying file.
Memory mapping can increase I/O performance of large files, compared to buffered read / write operations from std.file and std.stdio. However, I/O errors are not handled as safely: when for example the disk that the file is on gets removed, reading from it may result in a segfault.