[foreign-abi] RFR: 8248499: Add methods to allocate off heap arrays from Java arrays [v4]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Jul 1 14:37:55 UTC 2020


> This patch adds methods to NativeScope which allow clients to allocate off-heap arrays from Java on-heap arrays.
> 
> While in most cases the code for copying is straightforward, we have to take into account endianness mismatches (in
> case the user wants to store the array elements off-heap in an endianness that doesn't match that of the platform).
> To allow for that, I've added a new implementation method in AbstractMemorySegmentImpl, which is the same as
> `copyFrom`, but adds the byte swap (a wrapper around `Unsafe::copySwapMemory`).

Maurizio Cimadamore has updated the pull request with a new target base due to a merge or a rebase. The incremental
webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits
since the last revision:

 - Merge branch 'helpers-abi' of https://github.com/mcimadamore/panama-foreign into helpers-abi
   Fix javadoc
 - Tweak javadoc
 - Addressed review comments
 - Add extra method to NativeScope to allocate (empty) arrays with arbitrary element layouts
 - Remove whitespaces
 - Add test
 - Addressed review comments
 - Add extra method to NativeScope to allocate (empty) arrays with arbitrary element layouts
 - Remove whitespaces
 - Add test

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

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/222/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/222/files/86c572f3..955903a8

Webrevs:
 - full: https://webrevs.openjdk.java.net/panama-foreign/222/webrev.03
 - incr: https://webrevs.openjdk.java.net/panama-foreign/222/webrev.02-03

  Stats: 1001 lines in 10 files changed: 935 ins; 10 del; 56 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/222.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/222/head:pull/222

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


More information about the panama-dev mailing list