paleolimbot opened a new pull request, #14436:
URL: https://github.com/apache/arrow/pull/14436

   This PR makes it so that you can do the following without a warning:
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   
   register_scalar_function(
     "times_32",
     function(context, x) x * 32L,
     in_type = list(int32(), int64(), float64()),
     out_type = function(in_types) in_types[[1]],
     auto_convert = TRUE
   )
   
   register_scalar_function(
     "times_32",
     function(context, x) x * 32L,
     in_type = list(int32(), int64(), float64()),
     out_type = function(in_types) in_types[[1]],
     auto_convert = TRUE
   )
   ```
   
   In fixing that, I also ran across an important discovery, which is that 
`cpp11::function` does *not* protect the underlying `SEXP` from garbage 
collection!!!! It the two functions we used this for were being protected by 
proxy because the execution environment of `register_scalar_function()` was 
being saved when the binding was registered.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to