8000 dd: don't allocate buffer if count=0 by jfinkels · Pull Request #4130 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dd: don't allocate buffer if count=0 #4130

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

Merged
merged 1 commit into from
Nov 13, 2022

Conversation

jfinkels
Copy link
Collaborator

As an optimization, prevent dd from allocating buffers for use in its main loop when count=0.

This fixes some of the test cases in the GNU test suite file tests/dd/no-allocate.sh.

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/misc/timeout is no longer failing!

@sylvestre sylvestre force-pushed the dd-no-allocate-count-zero branch from 18c7313 to 1882b52 Compare November 12, 2022 08:59
@jfinkels jfinkels force-pushed the dd-no-allocate-count-zero branch from 1882b52 to 95964d0 Compare November 12, 2022 16:20
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?

Copy link
Member
@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

I like this solution! Clippy is grumpy though :)

As an optimization, prevent `dd` from allocating buffers for use in
its main loop when `count=0`.
@jfinkels jfinkels force-pushed the dd-no-allocate-count-zero branch from 95964d0 to 5ee5681 Compare November 12, 2022 23:18
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/misc/tee. tests/misc/tee is passing on 'main'. Maybe you have to rebase?

@tertsdiepraam
Copy link
Member

Looks good to me!

@tertsdiepraam tertsdiepraam merged commit 46016bf into uutils:main Nov 13, 2022
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.

2 participants
0