hu6360567 edited a comment on issue #994:
URL: https://github.com/apache/arrow-rs/issues/994#issuecomment-985254643


   In `pyarrow.rs`, I found some snippet for import/export with FFI.
   
https://github.com/apache/arrow-rs/blob/e9be49d962560ce5b87544a2933d8b207322cf60/arrow/src/pyarrow.rs#L110-L149
   
   The desired workflow of importing array from FFI:
   1. prepare ArrowArray and leak both pointers to FFI
   2. write C Data Interface into both pointers
   3. Import from both pointers, allocated in first step
   
   
   For safety notice of ArrowArray,
   
https://github.com/apache/arrow-rs/blob/e9be49d962560ce5b87544a2933d8b207322cf60/arrow/src/ffi.rs#L638-L643
   
   But, for the workflow of exporting to FFI, I didn't find when to release 
pointers created during `into_raw`.
   
https://github.com/apache/arrow-rs/blob/e9be49d962560ce5b87544a2933d8b207322cf60/arrow/src/pyarrow.rs#L136
   `arrow::ImportArray` moves the payload of pointer, but cannot release the 
pointer, since it is allocated by `Arc` in rust.
   Is it lead to a memory leak?
   


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