Skip to content

Commit 788d666

Browse files
authored
Use MAP_PRIVATE instead of MAP_SHARED
It is not intended to write data to the file for others to read.
1 parent 19b392d commit 788d666

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/llama-mmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ struct llama_mmap::impl {
271271
impl(struct llama_file * file, size_t prefetch, bool numa) {
272272
size = file->size();
273273
int fd = file->file_id();
274-
int flags = MAP_SHARED;
274+
int flags = MAP_PRIVATE;
275275
if (numa) { prefetch = 0; }
276276
#ifdef __linux__
277277
if (posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) {

0 commit comments

Comments
 (0)