[foreign-memaccess+abi] RFR: 8291639: Improve the ability to visualize a MemorySegment in human readable forms [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri May 26 15:18:16 UTC 2023


On Fri, 26 May 2023 13:16:35 GMT, Rémi Forax <forax at openjdk.org> wrote:

>> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 29 commits:
>> 
>>  - Merge master
>>  - Fix typos
>>  - Clean up toString methods
>>  - Add support for MemoryAddress arrays and improve docs
>>  - Improve javadoc
>>  - Change to IAE if mapper fails
>>  - Remove caching
>>  - Add tests for initial issue examples
>>  - Clean up and optimize
>>  - Add support for multidimensional records
>>  - ... and 19 more: https://git.openjdk.org/panama-foreign/compare/bee4503b...1d7db589
>
> src/java.base/share/classes/jdk/internal/foreign/LayoutRecordMapper.java line 373:
> 
>> 371:                                           Class<?> extra) throws NoSuchMethodException, IllegalAccessException {
>> 372: 
>> 373:         var pTypes = Stream.of(MemorySegment.class, layoutType, long.class, long.class, extra)
> 
> seems a weird way to test if extra is null

Using this method for both the primitive and the record case leads to issues. Better use a different way for the recursive record case. Also, you can create a method type from a List::of, which is probably simpler.

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

PR Review Comment: https://git.openjdk.org/panama-foreign/pull/833#discussion_r1206942805


More information about the panama-dev mailing list