zhztheplayer commented on PR #13248:
URL: https://github.com/apache/arrow/pull/13248#issuecomment-1211731895

   > I think what needs to happen is that C Data Interface allocations need to 
get associated with an actual allocator, even if the allocator isn't actually 
doing the allocation. 
   
   This is how we used to handle native-allocated blocks in Java dataset codes 
before migrating to ABI:
   
   `NativeUnderlyingMemory`:
   
   
https://github.com/apache/arrow/commit/d25660ed5f57b167878c96cafc23361421a73ca8#diff-177060b1e9fd73540eacd8d55a32a81702ddbc39b6f1f406702d345620fbd1ceR25
   
   Although the codes binding it to allocator was more like a workaround:
   
   
https://github.com/apache/arrow/commit/d25660ed5f57b167878c96cafc23361421a73ca8#diff-6f45bb0f8f4da15fddfe7027b1983fe16dda4332b1cba9a9f1a6f28a0fa66a26R101-R104
   
   I am not sure if introducing a new API `BufferAllocator#allocate(MemoryChunk 
chunk)` would be more reasonable here. The API is designed and implemented in 
our own forked Arrow repo:
   
   
https://github.com/oap-project/arrow/blob/c4bd7cc1a45991aedf8e4ddd5533d798361d24c7/java/memory/memory-core/src/main/java/org/apache/arrow/memory/BufferAllocator.java#L55-L62
   
   `MemoryChunk` interface is simplified from `AllocationManager`:
   
   
https://github.com/oap-project/arrow/blob/c4bd7cc1a45991aedf8e4ddd5533d798361d24c7/java/memory/memory-core/src/main/java/org/apache/arrow/memory/MemoryChunk.java#L20-L42


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to