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
3c848de784
commit
fa14f91a6b
|
@ -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