-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Update R handles in-place #6903
Conversation
All R tests now passing. The C++ failing test is probably not related to this PR. |
Thanks, I will look into it. Please ignore the osx test. The Apple clang is not happy with the new libomp. |
@david-cortes Aside: we've issued a guidance saying that users should avoid using |
I'm aware that saveRDS is not recommended, but that doesn't mean it's not useful. For example, when one restarts an R session keeping the variables/objects, these will be auto-saved through |
@david-cortes Got it. Just keep in mind that you will need to migrate existing RDS files using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I got to learn about how objects work in R.
Addressing issue #6896
When de-serializing an object in R from raw bytes, the R handles become null as there is no C++ object to which to point to in-memory. In these situations, the C++ objects are recreated from raw bytes as needed, but the R handle objects are not modified in-place, which can lead to de-serializing multiple times.
This PR changes it so that R external pointer objects would be modified in-place in order to avoid redundant operations and memory usage. After the PR: