@Test publicvoid testLargeSegmentCopy() { // Make sure the byte size is bigger than Integer.MAX_VALUE finalint longArrayLength = Integer.MAX_VALUE / Long.BYTES + 100; finallong[] array = newlong[longArrayLength];
try (var arena = Arena.openConfined()) { var segment = MemorySegment.allocateNative((long) longArrayLength * Long.BYTES, Long.SIZE, arena.scope()); // Should not throw an exception or error
MemorySegment.copy(segment, JAVA_LONG, 0, array, 0, longArrayLength); // Should not throw an exception or error
MemorySegment.copy(array,0, segment, JAVA_LONG, 0, longArrayLength);
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.