mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
(index) Use MemorySegment.copy for LongArray->LongArray transfers
This commit is contained in:
parent
a74df7f905
commit
60ad4786bc
@ -183,10 +183,11 @@ public class SegmentLongArray implements LongArray {
|
|||||||
throw new IndexOutOfBoundsException("Destination array too small");
|
throw new IndexOutOfBoundsException("Destination array too small");
|
||||||
|
|
||||||
MemorySegment.copy(
|
MemorySegment.copy(
|
||||||
source.getMemorySegment(), JAVA_LONG, sourceStartL,
|
source.getMemorySegment(), JAVA_LONG, sourceStartL * JAVA_LONG.byteSize(),
|
||||||
segment, JAVA_LONG, destStartL,
|
segment, JAVA_LONG, destStartL * JAVA_LONG.byteSize(),
|
||||||
destEndL - destStartL
|
destEndL - destStartL
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -284,10 +284,11 @@ public class UnsafeLongArray implements LongArray {
|
|||||||
throw new IndexOutOfBoundsException("Destination array too small");
|
throw new IndexOutOfBoundsException("Destination array too small");
|
||||||
|
|
||||||
MemorySegment.copy(
|
MemorySegment.copy(
|
||||||
source.getMemorySegment(), JAVA_LONG, sourceStartL,
|
source.getMemorySegment(), JAVA_LONG, sourceStartL * JAVA_LONG.byteSize(),
|
||||||
segment, JAVA_LONG, destStartL,
|
segment, JAVA_LONG, destStartL * JAVA_LONG.byteSize(),
|
||||||
destEndL - destStartL
|
destEndL - destStartL
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user