timsaucer commented on code in PR #18672: URL: https://github.com/apache/datafusion/pull/18672#discussion_r2557417735
########## datafusion/ffi/README.md: ########## @@ -101,6 +101,75 @@ In this crate we have a variety of structs which closely mimic the behavior of their internal counterparts. To see detailed notes about how to use them, see the example in `FFI_TableProvider`. +## Memory Management + +One of the advantages of Rust is the ownership model, which means programmers +_usually_ do not need to worry about memory management. When interacting with +foreign code, this is not necessarily true. If you review the structures in +this crate, you will find that many of them implement the `Drop` trait and +perform a foreign call. Review Comment: What exact text would you like to see? We account for the memory forgetting in the `Box::into_raw` during FFI struct creation and the corresponding `Box::from_raw` when we do the `release()`. I'm not quite sure what additional text you think would be helpful. The author of that blog was focused on language interoperability, which is something we've decided is not a current goal of this crate. Rather we're focused on Rust backed implementations. The Python work simply exposes these structs via PyCapsule - we don't actually support direct interaction of these methods with python. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
