Skip to content

Conversation

@alexs-sh
Copy link
Contributor

About

This is a minor improvement following the merge of #7915. It includes:

  • Defining the OPTIMAL_IO_BLOCK_SIZE constant using bitwise operations, similar to the BLOCK_SIZE constant
  • One additional test

Thank you

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@cakebaker
Copy link
Contributor

I'm not sure about the test. Wouldn't it make more sense to assert the condition at compile-time? Something like:

const _: () = assert!(OPTIMAL_IO_BLOCK_SIZE <= BLOCK_SIZE);

@alexs-sh
Copy link
Contributor Author

Sounds good. I'll try. Thx

alexs-sh added 2 commits May 21, 2025 14:54
The value of the variable remains unchanged (4096 = 2 ^ 12), but using a
bitwise expression provides two benefits:

- follows the same approach used for configuring BLOCK_SIZE

- indicates that a power-of-two value is preferred for this kind of
  constant
This commit adds checks for block size constants. Misconfigured sizes
could lead to overflows or performance issues. While such cases are
expected to be rare or unlikely, it's better to be notified of them
early.
@alexs-sh alexs-sh force-pushed the shred-minor-updates branch from de863a7 to 14a8f3f Compare May 21, 2025 13:55
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker merged commit 10b2a24 into uutils:main May 21, 2025
73 checks passed
@cakebaker
Copy link
Contributor

Thanks!

@alexs-sh
Copy link
Contributor Author

Thanks to you

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