pitrou commented on code in PR #37040:
URL: https://github.com/apache/arrow/pull/37040#discussion_r1301842095


##########
cpp/src/arrow/c/bridge.cc:
##########
@@ -714,11 +709,11 @@ Result<std::pair<std::optional<DeviceAllocationType>, 
int64_t>> ValidateDeviceIn
   return std::make_pair(device_type, device_id);
 }
 
-Status ExportDeviceArray(const Array& array, RawSyncEvent sync_event,
+Status ExportDeviceArray(const Array& array, 
std::shared_ptr<Device::SyncEvent> sync,
                          struct ArrowDeviceArray* out, struct ArrowSchema* 
out_schema) {
-  if (sync_event.sync_event != nullptr && sync_event.release_func) {
-    return Status::Invalid(
-        "Must provide a release event function if providing a non-null event");
+  void* sync_event{nullptr};
+  if (sync) {
+    sync_event = sync->get_raw();
   }

Review Comment:
   Nit, you coud make this terser
   ```suggestion
     void* sync_event = sync ? sync->get_raw() : nullptr;
   ```



##########
cpp/src/arrow/c/bridge.cc:
##########
@@ -714,11 +709,11 @@ Result<std::pair<std::optional<DeviceAllocationType>, 
int64_t>> ValidateDeviceIn
   return std::make_pair(device_type, device_id);
 }
 
-Status ExportDeviceArray(const Array& array, RawSyncEvent sync_event,
+Status ExportDeviceArray(const Array& array, 
std::shared_ptr<Device::SyncEvent> sync,
                          struct ArrowDeviceArray* out, struct ArrowSchema* 
out_schema) {
-  if (sync_event.sync_event != nullptr && sync_event.release_func) {
-    return Status::Invalid(
-        "Must provide a release event function if providing a non-null event");
+  void* sync_event{nullptr};
+  if (sync) {
+    sync_event = sync->get_raw();
   }

Review Comment:
   Nit, you could make this terser
   ```suggestion
     void* sync_event = sync ? sync->get_raw() : nullptr;
   ```



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