Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-6141: [C++] Enable memory-mapping a file region
This patch adds an Open() method for MemoryMappedFile() with length and offset params. In this way user can memory map a file region just like mmap(). The new API is: * MemoryMappedFile::Open(path, mode, length, offset, &mmap) The original API is still available. Calling the original API will memory map the whole file: * MemoryMappedFile::Open(path, mode, &mmap) A new field map_len_ is added in MemoryMappedFile::MemoryMap to track the real memory map length. Also MemoryMappedFile::Read()/ReadAt()/Write()/WriteAt() are changed to check the memory map length if it's a region based memory map. Note the MemoryMappedFile::Resize() is not supported if it's a region based memory map. Signey-off-by: Yuan Zhou <yuan.zhou@intel.com>
- Loading branch information
Showing
3 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters