mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
Merge
This commit is contained in:
commit
86dc760f9e
29 changed files with 750 additions and 209 deletions
|
@ -285,9 +285,11 @@ public interface SegmentAllocator {
|
|||
Objects.requireNonNull(array);
|
||||
Objects.requireNonNull(elementLayout);
|
||||
int size = Array.getLength(array);
|
||||
MemorySegment addr = allocate(MemoryLayout.sequenceLayout(size, elementLayout));
|
||||
MemorySegment.copy(heapSegmentFactory.apply(array), elementLayout, 0,
|
||||
addr, elementLayout.withOrder(ByteOrder.nativeOrder()), 0, size);
|
||||
MemorySegment addr = allocateArray(elementLayout, size);
|
||||
if (size > 0) {
|
||||
MemorySegment.copy(heapSegmentFactory.apply(array), elementLayout, 0,
|
||||
addr, elementLayout.withOrder(ByteOrder.nativeOrder()), 0, size);
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue