waynexia commented on code in PR #6336:
URL: https://github.com/apache/arrow-rs/pull/6336#discussion_r1764615483
##########
arrow-buffer/src/buffer/mutable.rs:
##########
@@ -517,8 +674,18 @@ impl<T: ArrowNativeType> From<Vec<T>> for MutableBuffer {
// Vec guaranteed to have a valid layout matching that of
`Layout::array`
// This is based on `RawVec::current_memory`
let layout = unsafe {
Layout::array::<T>(value.capacity()).unwrap_unchecked() };
+ let zelf = Self {
+ data,
+ len,
+ layout,
+ #[cfg(not(feature = "allocator_api"))]
+ allocator: Global,
+ #[cfg(feature = "allocator_api")]
+ allocator: *value.allocator(),
Review Comment:
It will default to `Global` without `allocator_api`, and inherit from the
vector via `Vec::allocator()` API. Is this behavior ideal?
--
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]