Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/19222#discussion_r175678287
--- Diff:
common/unsafe/src/main/java/org/apache/spark/unsafe/array/LongArray.java ---
@@ -80,7 +76,7 @@ public void zeroOut() {
public void set(int index, long value) {
assert index >= 0 : "index (" + index + ") should >= 0";
assert index < length : "index (" + index + ") should < length (" +
length + ")";
- Platform.putLong(baseObj, baseOffset + index * WIDTH, value);
+ memory.putLong(memory.getBaseOffset() + index * WIDTH, value);
--- End diff --
Yeah, we can encourage more people to use the new memory management and its
API.
On the other hand, it would be good to take two-step approach:
1. Use new MemoryBlock with the current explicit offset usage
2. Hide offset stuff in the implementation.
WDYT?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]