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

Avoid double file buffering #13780

Merged

Conversation

carlhoerberg
Copy link
Contributor

Avoid allocating file buffers when not needed.

@@ -33,7 +33,7 @@ module Crystal::System::Random
return unless urandom.info.type.character_device?

urandom.close_on_exec = true
urandom.sync = true # don't buffer bytes
urandom.read_buffering = false # don't buffer bytes
Copy link
Member

Choose a reason for hiding this comment

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

For context: sync controls write buffering, which is completely irrelevant here. read_buffering is used to control read buffering.

src/digest/digest.cr Show resolved Hide resolved
src/file.cr Outdated Show resolved Hide resolved
@straight-shoota straight-shoota added this to the 1.10.0 milestone Sep 20, 2023
@straight-shoota straight-shoota merged commit 4099c7f into crystal-lang:master Sep 22, 2023
53 checks passed
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
Co-authored-by: Johannes Müller <straightshoota@gmail.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants