Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/19222#discussion_r172039217
--- 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 --
I see. To remove this assertion would not change the behavior.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]