jorgecarleitao opened a new pull request #8316: URL: https://github.com/apache/arrow/pull/8316
## Background Currently, a memory region (`arrow::buffer::BufferData`) always knows its capacity, that it uses to `drop` itself once it is no longer needed. It also knows whether it needs to be dropped or not via `BufferData::owner: bool`. However, this is insufficient for the purposes of supporting the C Data Interface, which requires informing the owner that the region is no longer needed, typically via a function call (`release`), for reference counting by the owner of the region. ## This PR This PR generalizes `BufferData` (and renames it to `Bytes`, which is more natural name for this structure, a-la `bytes::Bytes`) to support foreign deallocators. Specifically, it accepts two deallocation modes: * `Native(usize)`: the current implementation * `Foreign(Fn)`: an implementation that calls a function (which can be used to call a FFI) FYI @pitrou , @nevi-me @paddyhoran @sunchao Related to #8052 , which IMO is blocked by this functionality. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
