Github user 10110346 commented on a diff in the pull request: https://github.com/apache/spark/pull/19077#discussion_r166836868 --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/memory/HeapMemoryAllocator.java --- @@ -46,9 +46,12 @@ private boolean shouldPool(long size) { @Override public MemoryBlock allocate(long size) throws OutOfMemoryError { - if (shouldPool(size)) { + int numWords = (int) ((size + 7) / 8); --- End diff -- L51: assert (alignedSize >= size); I think `assert (alignedSize >= size) ` can make sure `(size + 7) / 8` doesn't exceed max int.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org