tustvold commented on a change in pull request #1297:
URL: https://github.com/apache/arrow-rs/pull/1297#discussion_r803457101
##########
File path: arrow/src/util/bit_chunk_iterator.rs
##########
@@ -466,8 +466,8 @@ mod tests {
#[test]
#[allow(clippy::assertions_on_constants)]
fn test_unaligned_bit_chunk_iterator() {
- // This test exploits the fact Buffer is at least 64-byte aligned
- assert!(ALIGNMENT > 64);
+ // This test exploits the fact Buffer is at least aligned to a u64
+ assert!(ALIGNMENT >= std::mem::align_of::<u64>());
Review comment:
The major change here is to `>=` which was just a :facepalm:
There are platforms where ALIGNMENT is only 4 bytes, but if this assertion
doesn't hold we have a broader issue here - as we assume that the data
allocated by `Buffer` can be
[`align_to::<u64>`](https://doc.rust-lang.org/1.30.0/std/primitive.slice.html#method.align_to)
without remainder throughout the arrow codebase
--
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]