[foreign-jextract] [Rev 01] RFR: 8246341: jextract should generate Cpointer utilities class
Jorn Vernee
jvernee at openjdk.java.net
Tue Jun 2 14:55:23 UTC 2020
On Tue, 2 Jun 2020 14:55:08 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:
>> Added Cpointer utilities class to deal with pointer values from C code.
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last
> revision:
> * missed EXPORT for 'func'
> * missed func call and assertion to check callback was reached.
> * renamed "resize" to "asArray"
Marked as reviewed by jvernee (Committer).
src/jdk.incubator.jextract/share/classes/jdk/incubator/jextract/tool/resources/Cpointer.java.template line 22:
> 21: private static MemoryAddress get(MemoryAddress addr) {
> 22: return MemoryAddress.ofLong((long) handle.get(addr));
> 23: }
Instead of doing the conversion manually here, you could also use the `MemoryHandles::asAddressVarHandle` conbinator to
create varhandles that accept and return a MemoryAddress directly.
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/191
More information about the panama-dev
mailing list