You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/02/10 09:18:00 UTC

[GitHub] [arrow-rs] tustvold commented on a change in pull request #1297: Fix test_unaligned_bit_chunk_iterator

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>` without remainder.




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org