pitrou commented on pull request #8287:
URL: https://github.com/apache/arrow/pull/8287#issuecomment-704423199
You're doing it wrong. I suggest again that you try to follow how C++ does
things, otherwise you'll get lost.
For example, your `release` callback assumes that buffers have been
allocated by Rust. This is trivially wrong if e.g. roundtripping from Python to
Rust to Python.
So, what needs to happen is you have something like this (not necessarily
working, but you get the idea):
```rust
struct ExportedArrayData {
buffers: Vec<Buffer> buffers,
// other stuff perhaps...
};
```
Then your `private_data` must point to an heap-allocated `ExportedArrayData`
(perhaps it's a `Pin<Box<ExportedArrayData>>`? I don't know). Your `release`
callback will cast back `private_data` to `ExportedArrayData` and destroy it
(releasing all the buffers).
And again, I suggest you tackle importing and exporting separately. I cannot
help you if you ignore what I tell you.
----------------------------------------------------------------
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]