[foreign-abi] RFR: 8248499: Add methods to allocate off heap arrays from Java arrays [v3]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Tue Jun 30 21:43:58 UTC 2020
On Tue, 30 Jun 2020 12:41:15 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Addressed review comments
>
> Marked as reviewed by jvernee (Committer).
I've addressed most of the comments; I also added an extra method `allocateArray(MemoryLayout, long)` to allocate an
'empty' array with given layout. This "just" a shortcut for `allocate(MemoryLayout.ofSequence(...))` but I think it's
very handy - e.g. to create empty pointer arrays, as in:
MemoryAddress addr = scope.allocateArray(C_POINTER, 42);
> Should this maybe be a public API in MemorySegment as well?
I'll prefer to leave that discussion for another patch
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/222
More information about the panama-dev
mailing list