You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/11/17 15:50:12 UTC

ignite git commit: Fix.

Repository: ignite
Updated Branches:
  refs/heads/ignite-1.6.10-hadoop-debug a863eeed9 -> 6e62ae1b8


Fix.


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

Branch: refs/heads/ignite-1.6.10-hadoop-debug
Commit: 6e62ae1b8ad2cb843945ad9961d16ed898d656a5
Parents: a863eee
Author: devozerov <vo...@gridgain.com>
Authored: Thu Nov 17 18:50:05 2016 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Nov 17 18:50:05 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/offheap/unsafe/GridUnsafeMemory.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6e62ae1b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemory.java b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemory.java
index 87ba2f2..aac91ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemory.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemory.java
@@ -607,7 +607,12 @@ public class GridUnsafeMemory {
      * @return The same array as passed in one.
      */
     public byte[] readBytes(long ptr, byte[] arr, int off, int len) {
-        GridUnsafe.copyMemory(null, ptr, arr, GridUnsafe.BYTE_ARR_OFF + off, len);
+        if (len <= 16) {
+            for (int i = 0; i < len; i++)
+                GridUnsafe.putByte(arr, off + i, GridUnsafe.getByte(ptr + i));
+        }
+        else
+            GridUnsafe.copyMemory(null, ptr, arr, GridUnsafe.BYTE_ARR_OFF + off, len);
 
         return arr;
     }