kou commented on a change in pull request #12237:
URL: https://github.com/apache/arrow/pull/12237#discussion_r791280678



##########
File path: c_glib/arrow-cuda-glib/cuda.cpp
##########
@@ -288,7 +288,9 @@ garrow_cuda_buffer_new(GArrowCUDAContext *context,
   auto arrow_context = garrow_cuda_context_get_raw(context);
   auto arrow_buffer = arrow_context->Allocate(size);
   if (garrow::check(error, arrow_buffer, "[cuda][buffer][new]")) {
-    return garrow_cuda_buffer_new_raw(&(*arrow_buffer));
+    std::shared_ptr<arrow::cuda::CudaBuffer> cuda_buffer =
+      arrow_buffer.MoveValueUnsafe();
+    return garrow_cuda_buffer_new_raw(&cuda_buffer);

Review comment:
       Could you use `arrow_` prefix for C++ objects?
   
   ```c++
   auto arrow_buffer_result = arrow_context->Allocate(size);
   if (garrow::check(error, arrow_buffer_result, "[cuda][buffer][new]")) {
     std::shared_ptr<arrow::cuda::CudaBuffer> arrow_buffer = 
*arrow_buffer_result;
     return garrow_cuda_buffer_new_raw(&arrow_cuda_buffer);
   ```

##########
File path: c_glib/arrow-cuda-glib/cuda.cpp
##########
@@ -288,7 +288,9 @@ garrow_cuda_buffer_new(GArrowCUDAContext *context,
   auto arrow_context = garrow_cuda_context_get_raw(context);
   auto arrow_buffer = arrow_context->Allocate(size);
   if (garrow::check(error, arrow_buffer, "[cuda][buffer][new]")) {
-    return garrow_cuda_buffer_new_raw(&(*arrow_buffer));
+    std::shared_ptr<arrow::cuda::CudaBuffer> cuda_buffer =
+      arrow_buffer.MoveValueUnsafe();
+    return garrow_cuda_buffer_new_raw(&cuda_buffer);

Review comment:
       Thanks!




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