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

Wes McKinney commented on ARROW-11143:
--------------------------------------

Indeed. If you need to be able to capture failure information, you probably 
want to do that via your implementation (or wrapper thereof) of MemoryPool, 
then add appropriate checks of the captured error information around the known 
deallocation points where you believe errors are possible. 

> [C++] Support status return for method MemoryPool::Free
> -------------------------------------------------------
>
>                 Key: ARROW-11143
>                 URL: https://issues.apache.org/jira/browse/ARROW-11143
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Hongze Zhang
>            Priority: Major
>
> Currently MemoryPool::Free has void return: 
> https://github.com/apache/arrow/blob/e05f032c1e5d590ac56372d13ec637bd28b47a96/cpp/src/arrow/memory_pool.h#L88.
> This is not enough for some complicated scenarios like in ARROW-7808, we 
> bring some possible JNI calls in the method within class 
> ReservationListenableMemoryPool: 
> https://github.com/apache/arrow/pull/7030/files#diff-ad18b6c937b5960c70ef6825654a98de6ee33ae72127a4af4895afe944966144R582-R604.
> We can discuss more on this before actually solving this issue in case we 
> think of `Free` is always a error-free behavior comparing to `Allocate`. 
> Anyway if the logic of cod e grows there will always be complicated codes 
> that can throw errors to be brought. Anyway we can expect some more comments 
> to this topic from dev.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to