[foreign-memaccess+abi] RFR: 8291639: Improve the ability to visualize a MemorySegment in human readable forms [v4]
Maurizio Cimadamore
mcimadamore at openjdk.org
Thu Aug 4 10:01:26 UTC 2022
On Thu, 4 Aug 2022 09:46:29 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Per-Åke Minborg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix failing test and rename variables
>
> src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 1892:
>
>> 1890: * </ul>
>> 1891: * </li>
>> 1892: * <li>Grouped layouts are enclosed in curly brackets.</li>
>
> Shouldn't it be "values that are part of a group layout" ? Also maybe add a linkplain to `GroupLayout`. Same for sequence layout. I also note that you use the "are rendered" in the above text. Maybe you can lean on it - e.g.
>
> "values in a group layout are rendered with enclosing curly braces".
Possible questions: why are address values represented as toString? Or numbers in decimal form? What if I want hex form? This is the part that makes me uncomfortable about this method: in a way, you almost want it to generate some kind of XML or json schema - and then leave the toString mapping to the user - but this method is doing everything, so it has to make opinionated choices at every step of the way, and I can see how some of those choices would be good for some and bad for others.
-------------
PR: https://git.openjdk.org/panama-foreign/pull/695
More information about the panama-dev
mailing list