You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jorisvandenbossche (via GitHub)" <gi...@apache.org> on 2023/05/11 14:35:55 UTC

[GitHub] [arrow] jorisvandenbossche commented on issue #34031: [Python] Use PyCapsule for communicating C Data Interface pointers at the Python level

jorisvandenbossche commented on issue #34031:
URL: https://github.com/apache/arrow/issues/34031#issuecomment-1544103104

   > > * The consumer renames the capsule (which gives some protection to the C Data pointer being consumed more than once)
   > 
   > This doesn't seem necessary in our case, as the consumer would typically move the C struct contents.
   
   But can a consumer move the C struct content multiple times (and potentially calling the release callback multiple times?)
   
   The other reason for renaming in the case of DLPack is that it checks for this in the capsule deleter, to only call the release callback of the struct in case it was not consumed/renamed (for example [cupy's implementation](https://github.com/cupy/cupy/blob/cb71365934dd5fa8197578ba55b74370cf07951a/cupy/_core/dlpack.pyx#L79-L85)). But that's in the end the same question I assume, because it also depends on whether it is OK to call the release callback multiple times.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org