[ 
https://issues.apache.org/jira/browse/ARROW-1947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16305861#comment-16305861
 ] 

ASF GitHub Bot commented on ARROW-1947:
---------------------------------------

pcmoritz commented on a change in pull request #1444: ARROW-1947: [Plasma] 
Change Client Create and Get to use Buffers
URL: https://github.com/apache/arrow/pull/1444#discussion_r159014629
 
 

 ##########
 File path: cpp/src/plasma/client.cc
 ##########
 @@ -162,14 +166,16 @@ Status PlasmaClient::Create(const ObjectID& object_id, 
int64_t data_size,
   ARROW_CHECK(object.metadata_size == metadata_size);
   // The metadata should come right after the data.
   ARROW_CHECK(object.metadata_offset == object.data_offset + data_size);
-  *data = lookup_or_mmap(fd, object.handle.store_fd, object.handle.mmap_size) +
-          object.data_offset;
+  *data = std::make_shared<MutableBuffer>(
+      lookup_or_mmap(fd, object.handle.store_fd, object.handle.mmap_size) +
+          object.data_offset,
+      data_size + metadata_size);
 
 Review comment:
   I think it's more natural to have data_size here, because the metadata is 
never modified through this buffer and always passed in through the metadata 
pointer. In fact the metadata being stored as part of the object buffer is an 
implementation detail.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [Plasma] Change Client Create and Get to use Buffers
> ----------------------------------------------------
>
>                 Key: ARROW-1947
>                 URL: https://issues.apache.org/jira/browse/ARROW-1947
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Plasma (C++)
>            Reporter: William Paul
>              Labels: pull-request-available
>
> This is primarily preparation for ARROW-1394 for returning CudaBuffers, but 
> also allows Arrow buffer tools to be used with Plasma.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to