ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [1/5] ignite git commit: IGNITE-4270: Allow GridUnsafe.UNALIGNED flag override.
Date Thu, 24 Nov 2016 10:13:41 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1.8 4d2432510 -> e43ea5ee9


IGNITE-4270: Allow GridUnsafe.UNALIGNED flag override.


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

Branch: refs/heads/ignite-1.8
Commit: 7a47a0185d308cd3a58c7bfcb4d1cd548bff5b87
Parents: b038730
Author: devozerov <vozerov@gridgain.com>
Authored: Thu Nov 24 11:14:08 2016 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Thu Nov 24 11:14:08 2016 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/IgniteSystemProperties.java | 7 +++++++
 .../java/org/apache/ignite/internal/util/GridUnsafe.java    | 9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7a47a018/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
index 22cb9a6..043c95a 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteSystemProperties.java
@@ -487,6 +487,13 @@ public final class IgniteSystemProperties {
     public static final String IGNITE_BINARY_SORT_OBJECT_FIELDS = "IGNITE_BINARY_SORT_OBJECT_FIELDS";
 
     /**
+     * Whether Ignite can access unaligned memory addresses.
+     * <p>
+     * Defaults to {@code} false, meaning that unaligned access will be performed only on
x86 architecture.
+     */
+    public static final String IGNITE_UNALIGNED_MEMORY_ACCESS = "IGNITE_UNALIGNED_MEMORY_ACCESS";
+
+    /**
      * Enforces singleton.
      */
     private IgniteSystemProperties() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/7a47a018/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
index 1f7a53c..1c492ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridUnsafe.java
@@ -22,6 +22,8 @@ import java.nio.ByteOrder;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+
+import org.apache.ignite.IgniteSystemProperties;
 import sun.misc.Unsafe;
 
 /**
@@ -1204,7 +1206,12 @@ public abstract class GridUnsafe {
     private static boolean unaligned() {
         String arch = System.getProperty("os.arch");
 
-        return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64") || arch.equals("x86_64");
+        boolean res = arch.equals("i386") || arch.equals("x86") || arch.equals("amd64") ||
arch.equals("x86_64");
+
+        if (!res)
+            res = IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_UNALIGNED_MEMORY_ACCESS,
false);
+
+        return res;
     }
 
     /**


Mime
View raw message