Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Add a closefd boolean argument to the chunk_generator function. #17

Open
Friz-zy opened this issue Jun 27, 2023 · 0 comments
Open

Comments

@Friz-zy
Copy link

Friz-zy commented Jun 27, 2023

Currently, the fastcdc_(py|cy) functions leave the file descriptor open after returning the generator since the generator requires it. This can result in a memory leak for non-CPython interpreters that do not utilize memory reference counting. To address this issue, I propose adding a boolean parameter called closefd to the chunk_generator function, along with some corresponding if code. I am confident that I can make these changes myself once my current pull request #16 is merged.

Alternative: Convert fastcdc_(py|cy) functions into generators themselves plus using with open(...) expression inside.

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

No branches or pull requests

1 participant