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

Paul Sandoz psandoz at openjdk.java.net
Mon Mar 7 21:55:32 UTC 2022


On Mon, 7 Mar 2022 14:18:57 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> 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.

Marked as reviewed by psandoz (Committer).

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

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


More information about the panama-dev mailing list