zeroshade commented on code in PR #40807:
URL: https://github.com/apache/arrow/pull/40807#discussion_r1541313200
##########
cpp/src/arrow/c/bridge.h:
##########
@@ -321,6 +321,37 @@ ARROW_EXPORT
Status ExportChunkedArray(std::shared_ptr<ChunkedArray> chunked_array,
struct ArrowArrayStream* out);
+/// \brief Export C++ RecordBatchReader using the C device stream interface
+///
+/// The resulting ArrowDeviceArrayStream struct keeps the record batch reader
+/// alive until its release callback is called by the consumer. The device
+/// type is determined by calling device_type() on the RecordBatchReader.
+///
+/// \note it is assumed that the output pointer has already be zeroed out
before
+/// calling this function.
Review Comment:
I added this note because I noticed that the other export methods also did
not, themselves, do a memset and expected that the output pointer has already
been zeroed out.
> If it is something worth adding here, it would be sufficient that the
structure pointed to by the output pointer is marked as released (not
necessarily completely zeroed out).
That's fair, though for some interoperability situations (like the
connections with Go/CGO) we ended up having to add a trampoline that calls
memset to zero it out in order to be safe. But i'd be fine with just saying
this should be released
--
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]