-
Notifications
You must be signed in to change notification settings - Fork 46
Description
When developing https://github.com/paleolimbot/duckdb-nanoarrow it was apparent that we need the ability to inject an ArrowBufferAllocator
into the ArrowIpcArrayStreamReader
for clients that need tight control over memory usage.
There is also at least one place in the device API where we assume a buffer allocator:
arrow-nanoarrow/src/nanoarrow/nanoarrow_device.h
Lines 220 to 223 in e54b7df
ArrowErrorCode (*buffer_init)(struct ArrowDevice* device_src, struct ArrowBufferView src, struct ArrowDevice* device_dst, struct ArrowBuffer* dst, void* stream);
In those two examples specifically a lack of custom allocator isn't blocking any real-world case (in DuckDB we can also do a better job coordinating IO if we skip the ArrowIpcArrayStreamReader
entirely and go through the lower-level ArrowIpcDecoder
; in cudf they have their own code for copying arrays and don't use the device API); however, the option should still be there.