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:
parent
ca00cbeed2
commit
25c6cd3a4f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue