HBASE-22496 UnsafeAccess.unsafeCopy should not copy more than UNSAFE_COPY_THRESHOLD on each iteration
Signed-off-by: huzheng <openinx@gmail.com>
This commit is contained in:
parent
68a01606ac
commit
e0197ac615
|
@ -100,7 +100,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