[foreign-preview] RFR: 8282211: SegmentAllocator array factories should use varargs

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Mar 7 14:25:40 UTC 2022


This is a trivial patch which replaces array parameter types in `SegmentAllocator::allocateArray` methods with varargs ones.
This makes very trivial use cases of the API more compact and succint, as in:


MemorySegment segment = allocator.allocateArray(JAVA_INT, 1, 2, 3);


Of course in the general (and more common) case, passing arrays is still possible.

-------------

Commit messages:
 - Initial push

Changes: https://git.openjdk.java.net/panama-foreign/pull/664/files
 Webrev: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=664&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8282211
  Stats: 21 lines in 1 file changed: 0 ins; 0 del; 21 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/664.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/664/head:pull/664

PR: https://git.openjdk.java.net/panama-foreign/pull/664


More information about the panama-dev mailing list