We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7565342 commit 5ca9876Copy full SHA for 5ca9876
extension/data_loader/mmap_data_loader.cpp
@@ -193,14 +193,13 @@ Result<FreeableBuffer> MmapDataLoader::load(
193
map_size = file_size_ - range.start;
194
}
195
196
- // Map the pages read-only. MAP_PRIVATE vs. MAP_SHARED doesn't matter since
197
- // the data is read-only, but use PRIVATE just to further avoid accidentally
198
- // 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.
199
void* pages = ::mmap(
200
nullptr,
201
map_size,
202
PROT_READ,
203
- MAP_PRIVATE,
+ MAP_SHARED,
204
fd_,
205
static_cast<off_t>(range.start));
206
ET_CHECK_OR_RETURN_ERROR(
0 commit comments