Skip to content

Remove restrict from const objects #6791

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 3 commits into from
Apr 9, 2024
Merged

Remove restrict from const objects #6791

merged 3 commits into from
Apr 9, 2024

Conversation

akuzm
Copy link
Member

@akuzm akuzm commented Mar 27, 2024

We don't really need it if we systematically use restrict on the read/write objects.

This is a minor refactoring to avoid confusion, shouldn't actually change any behavior or code generation.

For the reference on how to use restrict with const see https://stackoverflow.com/a/43671121

No changes in tsbench as expected: https://grafana.ops.savannah-dev.timescale.com/d/fasYic_4z/compare-akuzm?orgId=1&var-branch=All&var-run1=3394&var-run2=3397&var-threshold=0&var-use_historical_thresholds=true&var-threshold_expression=2.5%20%2A%20percentile_cont%280.90%29&var-exact_suite_version=false

Disable-check: force-changelog-file

We don't really need it if we systematically use restrict on the
read/write objects.
@akuzm akuzm mentioned this pull request Mar 27, 2024
7 tasks
Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.96%. Comparing base (59f50f2) to head (59d7851).
Report is 97 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6791      +/-   ##
==========================================
+ Coverage   80.06%   80.96%   +0.90%     
==========================================
  Files         190      194       +4     
  Lines       37181    36854     -327     
  Branches     9450     9648     +198     
==========================================
+ Hits        29770    29840      +70     
- Misses       2997     3164     +167     
+ Partials     4414     3850     -564     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mkindahl mkindahl self-requested a review March 28, 2024 07:40
Comment on lines +43 to +44
const Simple8bRleBitmap tag0s = simple8brle_bitmap_prefixsums(gorilla_data->tag0s);
const Simple8bRleBitmap tag1s = simple8brle_bitmap_prefixsums(gorilla_data->tag1s);
Copy link
Member

Choose a reason for hiding this comment

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

This is OK, but it is different from the other const usage: this makes tag0s and tag1s constant, the other cases made *whatever constant, but not whatever. Not sure if it was intentional or not, given that you haven't used the same principle in the other cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, probably we should use const void *data in the Simple8bRleBitmap. I'll update it as well if it's possible.

@akuzm akuzm enabled auto-merge (squash) April 9, 2024 12:48
@akuzm akuzm merged commit 2a30ca4 into timescale:main Apr 9, 2024
@akuzm akuzm deleted the restrict branch April 9, 2024 12:48
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.

3 participants