Github user Ngone51 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19222#discussion_r172019234
--- Diff:
common/unsafe/src/main/java/org/apache/spark/unsafe/memory/UnsafeMemoryAllocator.java
---
@@ -36,22 +42,35 @@ public MemoryBlock allocate(long size) throws
OutOfMemoryError {
@Override
public void free(MemoryBlock memory) {
- assert (memory.obj == null) :
+ assert(memory instanceof OffHeapMemoryBlock);
+ if (memory == OffHeapMemoryBlock.NULL) return;
+ assert (memory.getBaseObject() == null) :
--- End diff --
> its object may not be``` null```
Hi, @kiszk. Actually, I think, here, object must be ```null```. Because I
only see one constructor of ```OffHeapMemoryBlock ```:
```
public OffHeapMemoryBlock(long address, long size) {
super(null, address, size);
}
```
WDYT?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]