avantgardnerio commented on code in PR #27097:
URL: https://github.com/apache/datafusion/pull/27097#discussion_r4472342860


##########
datafusion/common/src/utils/memory.rs:
##########
@@ -604,93 +602,115 @@ fn array_children(array: &ArrayRef) -> Vec<&ArrayRef> {
 }
 
 /// Tracks a small number of buffers inline, avoiding a heap allocation for
-/// typical batches, and promotes to a hash set when more buffers are seen.
+/// typical batches, and promotes to a hash map when more buffers are seen.
+///
+/// Keeps the largest capacity seen per address: FFI-imported slices of one
+/// allocation share an address but report the length they were imported with.

Review Comment:
   This holds for any buffer built with `Buffer::from_custom_allocation`, not 
only FFI imports. We hit the same pattern from a helper that re-wraps trimmed 
slices to report their real size. Naming the general case here keeps a later 
change from narrowing the fix to FFI.
   
   ```suggestion
   /// Keeps the largest capacity seen per address: buffers built with
   /// `Buffer::from_custom_allocation`, such as FFI imports, can share an 
address
   /// while reporting different capacities.
   ```
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to