Fix: do not close file on mmap (#1017)

pull/1022/head master-47f61aa
slaren 1 year ago committed by GitHub
parent 3173a62eb9
commit 47f61aaa5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -176,7 +176,6 @@ struct llama_mmap {
flags |= MAP_POPULATE;
#endif
addr = mmap(NULL, file->size, PROT_READ, flags, fd, 0);
close(fd);
if (addr == MAP_FAILED) {
throw format("mmap failed: %s", strerror(errno));
}

Loading…
Cancel
Save