Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions extension/data_loader/mmap_data_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,13 @@ Result<FreeableBuffer> MmapDataLoader::load(
map_size = file_size_ - range.start;
}

// Map the pages read-only. MAP_PRIVATE vs. MAP_SHARED doesn't matter since
// the data is read-only, but use PRIVATE just to further avoid accidentally
// modifying the file.
// Map the pages read-only. Use shared mappings so that other processes
// can also map the same pages and share the same memory.
void* pages = ::mmap(
nullptr,
map_size,
PROT_READ,
MAP_PRIVATE,
MAP_SHARED,
fd_,
static_cast<off_t>(range.start));
ET_CHECK_OR_RETURN_ERROR(
Expand Down
Loading