You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by op...@apache.org on 2019/05/30 02:20:35 UTC

[hbase] branch branch-2.1 updated: HBASE-22496 UnsafeAccess.unsafeCopy should not copy more than UNSAFE_COPY_THRESHOLD on each iteration

This is an automated email from the ASF dual-hosted git repository.

openinx pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new fa14f91  HBASE-22496 UnsafeAccess.unsafeCopy should not copy more than UNSAFE_COPY_THRESHOLD on each iteration
fa14f91 is described below

commit fa14f91a6b6c4424f4a700236229707bbe1ed327
Author: Wellington Chevreuil <we...@gmail.com>
AuthorDate: Wed May 29 17:27:21 2019 +0100

    HBASE-22496 UnsafeAccess.unsafeCopy should not copy more than UNSAFE_COPY_THRESHOLD on each iteration
    
    Change-Id: I259bc54a0a5b3474d3c455639c3e9cb1e95c8438
    
    Signed-off-by: huzheng <op...@gmail.com>
---
 .../src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java
index 953ad5b..15d3cd5 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java
@@ -333,7 +333,7 @@ public final class UnsafeAccess {
   private static void unsafeCopy(Object src, long srcAddr, Object dst, long destAddr, long len) {
     while (len > 0) {
       long size = (len > UNSAFE_COPY_THRESHOLD) ? UNSAFE_COPY_THRESHOLD : len;
-      theUnsafe.copyMemory(src, srcAddr, dst, destAddr, len);
+      theUnsafe.copyMemory(src, srcAddr, dst, destAddr, size);
       len -= size;
       srcAddr += size;
       destAddr += size;