From fa14f91a6b6c4424f4a700236229707bbe1ed327 Mon Sep 17 00:00:00 2001 From: Wellington Chevreuil Date: Wed, 29 May 2019 17:27:21 +0100 Subject: [PATCH] HBASE-22496 UnsafeAccess.unsafeCopy should not copy more than UNSAFE_COPY_THRESHOLD on each iteration Change-Id: I259bc54a0a5b3474d3c455639c3e9cb1e95c8438 Signed-off-by: huzheng --- .../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 953ad5b533e..15d3cd542d8 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;