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

Non-API calls #1933

Open
lionel- opened this issue Apr 30, 2024 · 4 comments
Open

Non-API calls #1933

lionel- opened this issue Apr 30, 2024 · 4 comments

Comments

@lionel-
Copy link
Member

lionel- commented Apr 30, 2024

Easy:

Unknown:

  • SET_S4_OBJECT()/UNSET_S4_OBJECT(): Used for proxying / unproxying S4 objects. Can we do better?

Problematic:

  • SETLENGTH()/SET_TRUELENGTH(): Used in various algorithms for expansible vectors. Also used in data.table for the same purpose. Would be nice to find a solution with R core.
  • STDVEC_DATAPTR(): Part of the ALTREP API. Can we get this part of the experimental API that can be used in packages?
@DavisVaughan
Copy link
Member

I think STDVEC_DATAPTR() can be replaced with DATAPTR() but I may be wrong

@MichaelChirico
Copy link
Contributor

Commenting to follow here. @ben-schwen already linked our corresponding issue.

@MichaelChirico
Copy link
Contributor

MichaelChirico commented Jun 15, 2024

SET_S4_OBJECT()/UNSET_S4_OBJECT(): Used for proxying / unproxying S4 objects. Can we do better?

Looked at this a little bit. I think we can replace unset_s4() with asS3().

I gave up on r_mark_s4(), the goal would be to handle that with asS4() on the R side.

Alternatively, we might be able to use the C routine asS4() (untested, and not clear we're allowed to use it anyway)?

https://github.com/r-devel/r-svn/blob/main/src/main/objects.c#L1840

@Jean-Romain
Copy link

I think STDVEC_DATAPTR() can be replaced with DATAPTR() but I may be wrong

@DavisVaughan tested in my package. It passes all unit tests with no NOTE on devel

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

No branches or pull requests

4 participants