mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-08-15 20:53:00 -04:00
Fix: do not close file on mmap (#1017)
This commit is contained in:
@@ -176,7 +176,6 @@ struct llama_mmap {
|
|||||||
flags |= MAP_POPULATE;
|
flags |= MAP_POPULATE;
|
||||||
#endif
|
#endif
|
||||||
addr = mmap(NULL, file->size, PROT_READ, flags, fd, 0);
|
addr = mmap(NULL, file->size, PROT_READ, flags, fd, 0);
|
||||||
close(fd);
|
|
||||||
if (addr == MAP_FAILED) {
|
if (addr == MAP_FAILED) {
|
||||||
throw format("mmap failed: %s", strerror(errno));
|
throw format("mmap failed: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user