-
Notifications
You must be signed in to change notification settings - Fork 1k
removed const qualifier #7037
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
base: master
Are you sure you want to change the base?
removed const qualifier #7037
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7037 +/- ##
==========================================
- Coverage 98.69% 98.69% -0.01%
==========================================
Files 79 79
Lines 14676 14673 -3
==========================================
- Hits 14485 14482 -3
Misses 191 191 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I don't know what's wrong with the benchmark system, I had the same problem on my other PRs |
looks like something transient maybe... |
It would be good to quantify this, exactly. Are we talking % difference, fraction-of-%? Let's see if the atime suite tells us anything; would there be an easy way to measure it more directly, too? I'm particularly looking at the first case in the |
No obvious timing issues in HEAD=constCastRemoval Generated via commit 30a1917 Download link for the artifact containing the test results: ↓ atime-results.zip
|
Let's try to get rid of the newly appearing compiler warnings:
|
It's like christmas lights. If I untangle these warnings the entire thing falls apart. Why do we even need the cow page? I'm not sure I understand its purpose. |
There's code in fread.c written to the invariant that *eof=='\0'. If it
instead treated 'eof' as a past-the-end pointer that should never be
dereferenced (and the buffer as non-0-terminated), the code wouldn't
need to create that last zero in the memory in the first place.
|
@aitap I can't find that. can you point me to it? If so, that could be a silver bullet. |
It's not just one place, the code has been assuming this for 8 years. Consider |
I removed the const qualifier, as well as the
const_cast
function.Since it was a read-mostly object, the performance hit should be minimal, while removing all undefined behavior.
We can also experiment with restrict qualified pointers, but I want to get this merged first to avoid a longer approval process.