You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2022/01/19 19:44:00 UTC

[jira] [Commented] (ARROW-15373) [C++] MemoryManager::AllocateBuffer should return unique_ptr

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

Antoine Pitrou commented on ARROW-15373:
----------------------------------------

+1 on this change

> [C++] MemoryManager::AllocateBuffer should return unique_ptr
> ------------------------------------------------------------
>
>                 Key: ARROW-15373
>                 URL: https://issues.apache.org/jira/browse/ARROW-15373
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: David Li
>            Assignee: David Li
>            Priority: Major
>
> MemoryManager::AllocateBuffer currently returns shared_ptr<Buffer>, but analogously to arrow::AllocateBuffer, it should probably return unique_ptr<Buffer>. Also, we can convert a unique_ptr to a shared_ptr but not the other way around.
> This would be a breaking change in a core API, though. I _think_ this API is not used much, given it is relatively new, but we should keep this in mind.
> (Context: for the Flight/UCX prototype, I'm trying to integrate MemoryManager support given UCX can transparently handle some types of non-CPU memory, but while I've used mostly unique_ptr so far, MemoryManager uses shared_ptr which did cause a small snag.)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)