bit2swaz commented on code in PR #10431:
URL: https://github.com/apache/arrow-rs/pull/10431#discussion_r3676242169


##########
arrow-data/src/ffi.rs:
##########
@@ -53,15 +53,21 @@ pub struct FFI_ArrowArray {
     pub children: *mut *mut FFI_ArrowArray,
     /// Pointer to the underlying array of dictionary values
     pub dictionary: *mut FFI_ArrowArray,
-    /// Pointer to a producer-provided release callback
-    pub release: Option<unsafe extern "C" fn(arg1: *mut FFI_ArrowArray)>,
+    /// Producer-provided release callback.
+    ///
+    /// Private so safe code can't install a callback that [`Drop`] would 
invoke.

Review Comment:
   kept just the per-field `unsafe` setters and skipped `new_from_parts` for 
now. lmk if youd rather have it. only fields anyone writes are `release` + 
`private_data` anyway (thats what @ashdnazg's wrap-release does, read both out, 
swap both in, restore on release). the setters do that in place on a struct 
from anywhere. `new_from_parts` builds a fresh one instead, wrong shape for 
wrapping an existing foreign struct and its signature has to change every time 
a field gets added, the churn you flagged the setters dodge.
   
   its additive and non-breaking too so easy to add later if a real 
from-scratch case shows up. didnt wanna ship unsafe api with no caller yet so 
yeah



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