-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Move data mask cleaning from rlang to dplyr #3318
Comments
We might be able to avoid cleaning the data mask with weak references (
That's not very promising... |
On the other hand, we might also use a C++ implementation of weak references. To recap: We need to clean the data mask because otherwise a pointer to an object with limited lifetime might leak. We are not in control of the lifetime of the objects for which we share an |
Maybe an alternative is to add a Or: adding a finalizer to the environment containing the active bindings and clean up the relevant dplyr objects from that finalizer? |
One way or another, the proxy object needs to know that the data source isn't available anymore. I prefer controlling lifetime of internal dplyr classes from dplyr code. |
This needs an enhancement to bindrcpp, which I meant to release anyway before updating dplyr: krlmlr/bindrcpp#7. The current interface only supports naked pointers, I need to give up ownership at least for a proxy object. |
Is it useful to keep bindrcpp as a separate package? |
It has two downstream dependencies ;-) |
And, yes, the ping-pong between R and C++ is pretty convoluted, it helps to isolate it from the rest of the codebase. |
I have an implementation that uses |
@lionel-: Is there functionality in rlang that can replace bindr and bindrcpp? I kept these packages separate to avoid the Rcpp dependency in bindr. |
I don't understand completely what those packages do but I don't think so. |
- Avoid cleaning the data mask, a temporary environment used to evaluate expressions. If the environment, in which e.g. a `mutate()` expression is evaluated, is preserved until after the operation, accessing variables from that environment now gives a warning but still returns `NULL` (#3318).
bindr creates an environment full of almost identical active bindings. bindrcpp is the Rcpp interface to bindr. |
I think this functionality is too specific for rlang. |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
As we're no longer cleaning the mask by default.
Also investigate whether we can avoid active binding crashes without cleaning the data mask.
The text was updated successfully, but these errors were encountered: