[foreign-jextract] RFR: updating samples. changed constants class to use package constructor [v2]

Jorn Vernee jvernee at openjdk.java.net
Tue Aug 25 12:38:25 UTC 2020


On Tue, 25 Aug 2020 12:32:14 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> fixed to use package private constructors for constants classes. piggybacking to
>> include latest samples.
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last
> revision:
>   fixed titles of sections of time sample.

Marked as reviewed by jvernee (Committer).

doc/panama_jextract.md line 842:

> 841:         var index = clang_createIndex(0, 0);
> 842:         var tu = clang_parseTranslationUnit(index, toCString(args[0]),
> 843:             NULL, 0, NULL, 0, CXTranslationUnit_None());

This `toCString` should be allocated in the native scope below, so it gets cleaned up as well.

doc/panama_jextract.md line 848:

> 847:             var level = new int[1];
> 848:             var visitor = new MemorySegment[1];
> 849:

FWIW, I think you could avoid both of these by using an anonymous class instead of a lambda

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

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


More information about the panama-dev mailing list