Skip to content

Conversation

@MichaelChirico
Copy link
Member

Searched the sources:

grep -Er "const\b.*[*]\w+\s*=\s*[A-Z]+([^OR]|[^A]R)[(]" src

This is some low-hanging fruit in terms of better use of read-only accessors. There will be other cases where we can make the change to a const pointer as well, but those can't be identified with a simple regex.

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.02%. Comparing base (e13ea60) to head (60f2ba2).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7611   +/-   ##
=======================================
  Coverage   99.02%   99.02%           
=======================================
  Files          87       87           
  Lines       16903    16903           
=======================================
  Hits        16739    16739           
  Misses        164      164           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

  • HEAD=ro-access stopped early for DT[by,verbose=TRUE] improved in #6296
    Comparison Plot

Generated via commit 60f2ba2

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 5 minutes and 23 seconds
Installing different package versions 11 minutes and 21 seconds
Running and plotting the test cases 4 minutes and 4 seconds

@MichaelChirico
Copy link
Member Author

Another big class of cases where we could switch to _RO are call sites like INTEGER(x)[k] -- once we do [ to the output, we know we're only reading from x.

There are roughly 240 such sites (grep -Er "(INTEGER|LOGICAL|REAL|COMPLEX|RAW)[(]\w+[)]\[[^=]*$"), I just suspect it's not worth it to change them.

@MichaelChirico
Copy link
Member Author

I see this has some (or total) overlap with #7394. I think it's good to break out the changes into minimally-digestible parts -- here we focus only on const <type> *<var> = <writeable>(x) --> const <type> *<var> = <read-only>(x).

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.

1 participant