tustvold commented on PR #6616:
URL: https://github.com/apache/arrow-rs/pull/6616#issuecomment-2432753179

   > It is not about should or shouldn't. Comet reuses underlying buffers in 
the native reader. This is not exclusive to Comet.
   
   Rust's memory model disallows aliasing buffers in this way - see 
[here](https://doc.rust-lang.org/nomicon/aliasing.html). What you describe 
contravenes this model and is therefore UB. If you cannot guarantee that 
comet's native reader won't reuse the buffer behind Rust's back, you have to 
copy the memory into a fresh allocation. 


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