mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21: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");
|
||||
|
||||
MemorySegment.copy(
|
||||
source.getMemorySegment(), JAVA_LONG, sourceStartL,
|
||||
segment, JAVA_LONG, destStartL,
|
||||
source.getMemorySegment(), JAVA_LONG, sourceStartL * JAVA_LONG.byteSize(),
|
||||
segment, JAVA_LONG, destStartL * JAVA_LONG.byteSize(),
|
||||
destEndL - destStartL
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -284,10 +284,11 @@ public class UnsafeLongArray implements LongArray {
|
||||
throw new IndexOutOfBoundsException("Destination array too small");
|
||||
|
||||
MemorySegment.copy(
|
||||
source.getMemorySegment(), JAVA_LONG, sourceStartL,
|
||||
segment, JAVA_LONG, destStartL,
|
||||
source.getMemorySegment(), JAVA_LONG, sourceStartL * JAVA_LONG.byteSize(),
|
||||
segment, JAVA_LONG, destStartL * JAVA_LONG.byteSize(),
|
||||
destEndL - destStartL
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user