sunchao commented on code in PR #2061:
URL: https://github.com/apache/arrow-rs/pull/2061#discussion_r920727396


##########
arrow/src/util/bit_chunk_iterator.rs:
##########
@@ -333,7 +333,7 @@ impl Iterator for BitChunkIterator<'_> {
             // the constructor ensures that bit_offset is in 0..8
             // that means we need to read at most one additional byte to fill 
in the high bits
             let next = unsafe {
-                std::ptr::read_unaligned(raw_data.add(index + 1) as *const u8) 
as u64
+                std::ptr::read_volatile(raw_data.add(index + 1) as *const u8) 
as u64

Review Comment:
   I'm not sure if this breaks the alignment requirement since `read_volatile` 
requires `T` to be aligned while `read_unaligned` does not.
   
   At line 320, there is a comment:
   ```
   cast to *const u64 should be fine since we are using read_unaligned below
   ```
   and this is no longer valid. 



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