Expand description
Memory-Mapped File Serving
Provides zero-copy file serving using memory-mapped I/O for improved performance with large tensor files. This module enables efficient serving of tensors without loading the entire file into memory.
§Features
- Zero-copy serving - Direct memory mapping without buffer allocation
- Lazy loading - Map files only when accessed
- Range request support - Efficient partial file serving
- Platform optimizations - Uses OS-level optimizations (sendfile, etc.)
§Safety
Memory mapping is inherently unsafe as it involves raw pointer access. This module provides a safe wrapper that ensures proper lifetime management and error handling.
Structs§
- Mmap
Cache - A simple cache for memory-mapped files
- Mmap
Config - Platform-specific optimization hints
- Mmap
File - A handle to a memory-mapped file
Enums§
- Mmap
Error - Errors that can occur during memory-mapped operations