jhorstmann commented on issue #6362:
URL: https://github.com/apache/arrow-rs/issues/6362#issuecomment-2338282717
At a glance, this looks correct. I use it like the following, where `v` is
an `Arc<Vec<T, Allocator>>`:
```rust
let len = v.len() * std::mem::size_of::<T>();
let buffer = unsafe {
let ptr = NonNull::new_unchecked(v.as_ptr() as *mut u8);
Buffer::from_custom_allocation(ptr, len, v)
};
```
I'm being careful here to not use any references to the vector while a
mutable pointer exists, as that could lead to undefined behavior. But that does
not seem to be the problem here. Maybe the issue is with the `into_vec` method
instead?
--
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]