Repository: spark
Updated Branches:
  refs/heads/master c2c956bcd -> d39087147


[SPARK-13113] [CORE] Remove unnecessary bit operation when decoding page number

JIRA: https://issues.apache.org/jira/browse/SPARK-13113

As we shift bits right, looks like the bitwise AND operation is unnecessary.

Author: Liang-Chi Hsieh <[email protected]>

Closes #11002 from viirya/improve-decodepagenumber.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d3908714
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d3908714
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d3908714

Branch: refs/heads/master
Commit: d39087147ff1052b623cdba69ffbde28b266745f
Parents: c2c956b
Author: Liang-Chi Hsieh <[email protected]>
Authored: Wed Feb 3 23:17:51 2016 -0800
Committer: Davies Liu <[email protected]>
Committed: Wed Feb 3 23:17:51 2016 -0800

----------------------------------------------------------------------
 core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/d3908714/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java 
b/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java
index d31eb44..d2a8886 100644
--- a/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java
+++ b/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java
@@ -312,7 +312,7 @@ public class TaskMemoryManager {
 
   @VisibleForTesting
   public static int decodePageNumber(long pagePlusOffsetAddress) {
-    return (int) ((pagePlusOffsetAddress & MASK_LONG_UPPER_13_BITS) >>> 
OFFSET_BITS);
+    return (int) (pagePlusOffsetAddress >>> OFFSET_BITS);
   }
 
   private static long decodeOffset(long pagePlusOffsetAddress) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to