Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19222#discussion_r169983494
  
    --- Diff: 
common/unsafe/src/main/java/org/apache/spark/unsafe/memory/HeapMemoryAllocator.java
 ---
    @@ -58,7 +58,8 @@ public MemoryBlock allocate(long size) throws 
OutOfMemoryError {
                 final long[] array = arrayReference.get();
                 if (array != null) {
                   assert (array.length * 8L >= size);
    -              MemoryBlock memory = new MemoryBlock(array, 
Platform.LONG_ARRAY_OFFSET, size);
    +              MemoryBlock memory =
    +                new OnHeapMemoryBlock(array, Platform.LONG_ARRAY_OFFSET, 
size);
    --- End diff --
    
    `OnHeapMemoryBlock.fromArray`? we should hide `Platform.LONG_ARRAY_OFFSET` 
from the caller side.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to