Skip to content
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

Use STRING_PTR_RO, not STRING_PTR #6312

Merged
merged 3 commits into from
Jul 26, 2024
Merged

Use STRING_PTR_RO, not STRING_PTR #6312

merged 3 commits into from
Jul 26, 2024

Conversation

MichaelChirico
Copy link
Member

Part of #6180, thanks to recommendation in R-exts

@item STRING_PTR 
@itemx DATAPTR       
@itemx STDVEC_DATAPTR
       Use @code{STRING_PTR_RO} and @code{DATAPTR_RO}. Obtaining
        writable pointers to these data can violate the memory manager's
        integrity assumptions and is not supported.

@MichaelChirico
Copy link
Member Author

Actually this was not available in R 3.3.0, so we'll just use STRING_PTR() on really old R:

https://github.com/wch/r-source/blob/tags/R-3-3-0/src/include/Rinternals.h

It first got included in R 3.5.0:

r-devel/r-svn@cce3358
https://github.com/wch/r-source/blob/tags/R-3-5-0/src/include/Rinternals.h

@MichaelChirico MichaelChirico mentioned this pull request Jul 26, 2024
11 tasks
Copy link

github-actions bot commented Jul 26, 2024

Comparison Plot

Generated via commit f14ec4b

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

Time taken to finish the standard R installation steps: 11 minutes and 20 seconds

Time taken to run atime::atime_pkg on the tests: 3 minutes and 19 seconds

@HughParsonage
Copy link
Member

Actually this was not available in R 3.3.0, so we'll just use STRING_PTR() on really old R:

https://github.com/wch/r-source/blob/tags/R-3-3-0/src/include/Rinternals.h

It first got included in R 3.5.0:

r-devel/r-svn@cce3358 https://github.com/wch/r-source/blob/tags/R-3-5-0/src/include/Rinternals.h

I think this is fair. The objection to using this non-API call is because it would limit future changes to R, not because it was hazardous to use in past versions.

@MichaelChirico MichaelChirico merged commit 41fc24f into master Jul 26, 2024
5 checks passed
@MichaelChirico MichaelChirico deleted the stringptr-ro branch July 26, 2024 06:19
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