cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefa...@apache.org
Subject [03/10] cassandra git commit: MemoryUtil.getShort() should return an unsigned short also for aligned platforms
Date Wed, 29 Jun 2016 06:08:57 GMT
MemoryUtil.getShort() should return an unsigned short also for aligned platforms

patch by Rei Odaira; reviewed by Stefania Alborghetti for CASSANDRA-11973


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

Branch: refs/heads/cassandra-3.9
Commit: 38ed06136388be5a9d731b62bfcb0ae4d4e6c458
Parents: ea8c430
Author: Rei Odaira <Rei.Odaira@gmail.com>
Authored: Mon Jun 27 11:25:30 2016 +0800
Committer: Stefania Alborghetti <stefania.alborghetti@datastax.com>
Committed: Wed Jun 29 14:03:27 2016 +0800

----------------------------------------------------------------------
 CHANGES.txt                                                | 3 +++
 src/java/org/apache/cassandra/utils/memory/MemoryUtil.java | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/38ed0613/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9f42d98..48bd5aa 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,6 @@
+2.2.8
+ * MemoryUtil.getShort() should return an unsigned short also for architectures not supporting
unaligned memory accesses (CASSANDRA-11973)
+
 2.2.7
  * Allow nodetool info to run with readonly JMX access (CASSANDRA-11755)
  * Validate bloom_filter_fp_chance against lowest supported

http://git-wip-us.apache.org/repos/asf/cassandra/blob/38ed0613/src/java/org/apache/cassandra/utils/memory/MemoryUtil.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/memory/MemoryUtil.java b/src/java/org/apache/cassandra/utils/memory/MemoryUtil.java
index f4049a8..25d2dd8 100644
--- a/src/java/org/apache/cassandra/utils/memory/MemoryUtil.java
+++ b/src/java/org/apache/cassandra/utils/memory/MemoryUtil.java
@@ -120,7 +120,7 @@ public abstract class MemoryUtil
 
     public static int getShort(long address)
     {
-        return UNALIGNED ? unsafe.getShort(address) & 0xffff : getShortByByte(address);
+        return (UNALIGNED ? unsafe.getShort(address) : getShortByByte(address)) & 0xffff;
     }
 
     public static int getInt(long address)


Mime
View raw message