Skip to main content

Module mmap

Module mmap 

Source
Expand description

Race-safe bounded file reads.

The module name is retained for source compatibility, but project files are intentionally no longer memory-mapped. A repository file can be truncated by another editor or agent at any time; copying through Read keeps those races inside Rust’s safe I/O model.

Structs§

ShareableMap
Cloneable immutable file snapshot retained under the historical API name.

Constants§

DIRECT_READ_THRESHOLD
Legacy threshold retained for callers that used the old tuning constants.
MAX_MMAP_SIZE
Historical single-map ceiling, now the maximum ShareableMap snapshot size.
MAX_SEGMENTED_MMAP_SIZE
Legacy segmented-map ceiling retained for API compatibility.
SEGMENT_SIZE
Legacy map segment size retained for API compatibility.

Functions§

process_text_file_parallel
Process UTF-8 lines in parallel once the immutable snapshot exceeds 1 MB.
read_file_optimized
Read a complete file through bounded, race-detecting safe I/O.
read_file_segment
Read a specific byte segment through bounded, race-detecting safe I/O.
read_file_segment_to_string
Read one UTF-8 byte segment through the bounded snapshot reader.
read_file_to_string
Read a UTF-8 file through the bounded snapshot reader.