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

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

kou commented on issue #1691: ARROW-2251: [GLib] Keep GArrowBuffer alive while 
GArrowTensor for the buffer is live
URL: https://github.com/apache/arrow/pull/1691#issuecomment-370307240
 
 
   Partially right. `shared_ptr<Tensor>` keeps `shared_ptr<Buffer>` alive but 
memory in the `shard_ptr<Buffer>` may be freed when the `shared_ptr<Buffer>` 
just refers external memory. It's caused by creating `shard_ptr<Buffer>` by 
`Arrow::Buffer.new("...data...")` in Ruby. (It creates `GArrowBuffer` in C.) 
The `"...data..."` should be alive while the `Arrow::Buffer` is alive. 
`shared_ptr<Buffer>` is only alive without this change. Both 
`shared_ptr<Buffer>` and `GArrowBuffer` are alive with this change. The 
`GArrowBuffer` should keep the data alive.
   
   I'll send one more pull request to improve memory management in 
`GArrowBuffer`.

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


> [GLib] Destroying GArrowBuffer while GArrowTensor that uses the buffer causes 
> a crash
> -------------------------------------------------------------------------------------
>
>                 Key: ARROW-2251
>                 URL: https://issues.apache.org/jira/browse/ARROW-2251
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: GLib
>    Affects Versions: 0.8.0
>            Reporter: Kouhei Sutou
>            Assignee: Kouhei Sutou
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to