Github user srowen commented on a diff in the pull request: https://github.com/apache/spark/pull/19077#discussion_r166300538 --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/array/ByteArrayMethods.java --- @@ -40,6 +40,15 @@ public static int roundNumberOfBytesToNearestWord(int numBytes) { } } + public static long roundNumberOfBytesToNearestWord(long numBytes) { + long remainder = numBytes & 0x07; // This is equivalent to `numBytes % 8` --- End diff -- It's `8 * ((numBytes + 7) / 8)` but yeah, and the bit operation is unnecessarily complex IMHO. This is inherently a numeric operation, not bit-wise.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org