[foreign-jextract] [Rev 01] RFR: 8241925: jextract should generate simple allocation, access API for C primitive types

Athijegannathan Sundararajan sundar at openjdk.java.net
Wed Apr 1 10:45:54 UTC 2020


On Wed, 1 Apr 2020 10:16:05 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last
>> revision:
>>   * added static modifier to Cstring.toString method. Added tests for Cstring methods
>>   * added length accepting allocateArray overloadeds and using the same in samples.
>>   * using bulk copy for array copy
>>   * fixed samples to use Cstring method instead of methods from Foreign.
>
> src/jdk.incubator.jextract/share/classes/jdk/incubator/jextract/tool/resources/C-X.java.template line 40:
> 
>> 39:         arrayHandle.set(addr, index, value);
>> 40:     }
>> 41:
> 
> Could maybe name these `getArray` and `setArray`. We also have `allocateArray`, and it would make them a little easier
> to tell apart from the normal `get` and `set` when reading the code that uses them.

Maurizio suggested something similar (adding toJavaArray). We can revisit/adjust later if needed.

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

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


More information about the panama-dev mailing list