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

    https://github.com/apache/spark/pull/19222#discussion_r170504918
  
    --- Diff: 
common/unsafe/src/main/java/org/apache/spark/unsafe/memory/UnsafeMemoryAllocator.java
 ---
    @@ -19,15 +19,24 @@
     
     import org.apache.spark.unsafe.Platform;
     
    +import java.lang.reflect.InvocationTargetException;
    +import java.lang.reflect.Method;
    +import java.nio.ByteBuffer;
    +
    +import sun.nio.ch.DirectBuffer;
    +
     /**
      * A simple {@link MemoryAllocator} that uses {@code Unsafe} to allocate 
off-heap memory.
      */
     public class UnsafeMemoryAllocator implements MemoryAllocator {
     
       @Override
    -  public MemoryBlock allocate(long size) throws OutOfMemoryError {
    +  public OffHeapMemoryBlock allocate(long size) throws OutOfMemoryError {
    +    // No usage of DirectByteBuffer.allocateDirect is current design
    --- End diff --
    
    why mention this here?


---

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

Reply via email to