You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/07/13 15:29:05 UTC

[GitHub] [arrow] pitrou opened a new pull request #7731: ARROW-9428: [C++][Doc] Update buffer allocation documentation

pitrou opened a new pull request #7731:
URL: https://github.com/apache/arrow/pull/7731


   Use Result-returning AllocateBuffer() version in example.
   
   Also improve cross-referencing in some places.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] bkietz commented on a change in pull request #7731: ARROW-9428: [C++][Doc] Update buffer allocation documentation

Posted by GitBox <gi...@apache.org>.
bkietz commented on a change in pull request #7731:
URL: https://github.com/apache/arrow/pull/7731#discussion_r453792540



##########
File path: docs/source/cpp/memory.rst
##########
@@ -71,11 +74,12 @@ You can allocate a buffer yourself by calling one of the
 :func:`arrow::AllocateBuffer` or :func:`arrow::AllocateResizableBuffer`
 overloads::
 
-   std::shared_ptr<arrow::Buffer> buffer;
-
-   if (!arrow::AllocateBuffer(4096, &buffer).ok()) {
+   auto maybe_buffer = arrow::AllocateBuffer(4096);
+   if (!maybe_buffer.ok()) {
       // ... handle allocation error
    }
+
+   std::shared_ptr<arrow::Buffer> buffer = *maybe_buffer;

Review comment:
       Hmmm, I think we should be clearer about the type here
   ```suggestion
      arrow::Result<std::unique_ptr<Buffer>> maybe_buffer = arrow::AllocateBuffer(4096);
      if (!maybe_buffer.ok()) {
         // ... handle allocation error
      }
   
      std::shared_ptr<arrow::Buffer> buffer = *std::move(maybe_buffer);
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] github-actions[bot] commented on pull request #7731: ARROW-9428: [C++][Doc] Update buffer allocation documentation

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7731:
URL: https://github.com/apache/arrow/pull/7731#issuecomment-657629920


   https://issues.apache.org/jira/browse/ARROW-9428


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [arrow] wesm closed pull request #7731: ARROW-9428: [C++][Doc] Update buffer allocation documentation

Posted by GitBox <gi...@apache.org>.
wesm closed pull request #7731:
URL: https://github.com/apache/arrow/pull/7731


   


----------------------------------------------------------------
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:
users@infra.apache.org