paleolimbot opened a new pull request #11919: URL: https://github.com/apache/arrow/pull/11919
This PR limits the use of external pointers whose value is casted to double. It only uses the double-casted pointer when passing a pointer to Python because this is the only way I can get this to work (perhaps there is a better way that will result from this review or that could be implemented in the future). The PR changes the implementation of the `Pointer<>` wrapper to: - Do the right thing and use R's externalptr type internally (and accept pointers defined in this way). - Accept pointers defined as `void*` casted to `uintptr_t` casted to `double` (for backward compatibility) - Accept pointers defined as `integer64` (because it's what @amol- thought to do at first and somebody else might, too) - Accept pointers defined as `raw(<pointer size>)` (because it's a way that pointers could get passed to Python without changing reticulate) - Accept pointers defined as a character representation (as parsed by `strtoll()`) (as suggested by @pitrou) I imagine that we don't have to use one or more of these, but thought it best to implement and test them all and use the review to eliminate any options that will never get used. Things I'm not sure about: - My implementations of parsing and exporting pointers (new to this!) - The non-unwind-protected-ness of the `Pointer<>` constructor...it's written such that it's unlikely to longjmp but could possibly use `cpp11::safe[]()` to make this impossible. This doesn't seem to be used elsewhere in the Arrow R package so I didn't implement it here. -- 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]
