viirya commented on issue #9287:
URL: https://github.com/apache/arrow-rs/issues/9287#issuecomment-3809396489

   Looks like a valid issue.
   
   Looks like two issues:
     1. new_from_buffer() is too permissive - it accepts any MutableBuffer 
regardless of the target type's requirements
     2. as_slice() assumes guarantees that weren't enforced at construction time
   
   Probably we can:
   1. Make new_from_buffer() validate/enforce alignment requirements
   2. Make as_slice() check alignment at runtime and handle misaligned cases 
safely
   3. Mark new_from_buffer() as unsafe and document the alignment precondition
   


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