Function decompressed_file_mmap

Source
pub fn decompressed_file_mmap(
    path: &Path,
    uncompressed_path: Option<&Path>,
    expected_suffix: Option<&str>,
) -> Result<Mmap>
Expand description

Open the file as a mmap. .zstd files are first decompressed to uncompressed_path (or .zstd.uncompressed if not given) if the path does not exist already. The MMap is created using 2MB huge-pages on Linux. The usual caveats for memory maps applies: modifications of the file while using the map can change the data during parsing, which is safe or not depending on the parser. Truncating the file while accessing it will segfault the process. Leaving it marked safe here, for now.