kylebarron commented on code in PR #5070:
URL: https://github.com/apache/arrow-rs/pull/5070#discussion_r1391745519


##########
arrow-data/src/ffi.rs:
##########
@@ -66,8 +66,12 @@ impl Drop for FFI_ArrowArray {
 unsafe impl Send for FFI_ArrowArray {}
 unsafe impl Sync for FFI_ArrowArray {}
 
-// callback used to drop [FFI_ArrowArray] when it is exported
-unsafe extern "C" fn release_array(array: *mut FFI_ArrowArray) {
+/// callback used to drop [FFI_ArrowArray] when it is exported
+///
+/// # Safety
+///
+/// Must be passed a valid [FFI_ArrowArray].
+pub unsafe extern "C" fn release_array(array: *mut FFI_ArrowArray) {

Review Comment:
   I'm not familiar with the pycapsule internals, but one thing I wonder is 
whether it runs _any_ destructor if you use `PyCapsule::new` instead of 
`PyCapsule::new_with_destructor`. I.e. do you need even an empty 
   
   ```rs
   fn pycapsule_array_destructor(ffi_array: FFI_ArrowArray, _capsule_context: 
*mut c_void) {}
   ```
   to get the callback to take ownership again of the `ffi_array` to get rust 
to drop it? 



-- 
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