Skip to content

Conversation

slaren
Copy link
Member

@slaren slaren commented Apr 16, 2023

Fixes #963

Copy link
Contributor

@prusnak prusnak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no harm in not calling the close().

Since the underlying file is opened as read-only, the worst what can happen is that we will run out of file descriptors, which is hardly the case for llama.cpp.

Also, all file descriptors are closed by the kernel when the process exits.

@slaren
Copy link
Member Author

slaren commented Apr 16, 2023

The file should still be closed in the llama_file destructor, so I think this shouldn't cause any file descriptor leaks either.

@prusnak
Copy link
Contributor

prusnak commented Apr 16, 2023

The file should still be closed in the llama_file destructor, so I think this shouldn't cause any file descriptor leaks either.

Right. I just confirmed that close() in ~llama_file() is called even when mmap() is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android port error

2 participants