[foreign-jextract] RFR: Move MemoryAddress::copy (jextract version)

Jorn Vernee jvernee at openjdk.java.net
Fri May 15 16:51:27 UTC 2020

On Fri, 15 May 2020 16:42:09 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This patch addresses the remaining issues with jextrct templating mentioning the old MemoryAddress:copy method.

src/jdk.incubator.jextract/share/classes/jdk/incubator/jextract/tool/resources/C-X.java.template line 28:

> 27:         var heapSegment = MemorySegment.ofArray(arr);
> 28:         addr.segment().copyFrom(heapSegment);
> 29:     }

The behavior is not necessarily the same if `addr` is not the base address of the segment. I think the right move here
is to change the parameter from MemoryAddress to MemorySegment (same for Cstring).


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

More information about the panama-dev mailing list