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


##########
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 think the doc is for `read_unaligned` usage that accesses the buffer 
pointer as u64:
   
   ```
   let current = unsafe { std::ptr::read_unaligned(raw_data.add(index)).to_le() 
};
   ```
   
   For accessing `next`, we only read a byte and case the byte to u64. So it is 
not a problem.
   
   



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