HBASE-22496 UnsafeAccess.unsafeCopy should not copy more than UNSAFE_COPY_THRESHOLD on each iteration

Change-Id: I259bc54a0a5b3474d3c455639c3e9cb1e95c8438

Signed-off-by: huzheng <openinx@gmail.com>
This commit is contained in:
Wellington Chevreuil 2019-05-29 17:27:21 +01:00 committed by huzheng
parent 3c848de784
commit fa14f91a6b
1 changed files with 1 additions and 1 deletions

View File

@ -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;