diff --git a/llama.cpp b/llama.cpp index 854bb8993fbc5..5e817a6f12dfb 100644 --- a/llama.cpp +++ b/llama.cpp @@ -331,7 +331,7 @@ static void *mmap_file(const char *fname, uint64_t *mm_length) { int fd = open(fname, O_RDONLY); if (fd == -1) return 0; int64_t length = lseek(fd, 0, SEEK_END); - void *addr = mmap(NULL, length, PROT_READ, MAP_SHARED, fd, 0); + void *addr = mmap(NULL, length, PROT_READ, MAP_SHARED | MAP_ANONYMOUS | MAP_POPULATE, fd, 0); close(fd); if (addr == MAP_FAILED) return 0; #endif