[foreign-memaccess+abi] RFR: 8303666: Move address layout outside of ValueLayout namespace [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Mar 7 10:31:02 UTC 2023


On Tue, 7 Mar 2023 10:16:09 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/foreign/AddressLayout.java line 46:
>> 
>>> 44:  * layout is used to model the layout of the region of memory whose address is described by that address layout.
>>> 45:  * For instance, if an address layout has target layout {@link ValueLayout#JAVA_INT}, the region of memory pointed to by the address
>>> 46:  * described by the address layout is 4 bytes long. Specifying a target layout can be useful in the following situations:
>> 
>> Some redundant text here it seems
>> Suggestion:
>> 
>>  * For instance, if an address layout has target layout {@link ValueLayout#JAVA_INT}, the region of memory 
>>  * described by the address layout is 4 bytes long. Specifying a target layout can be useful in the following situations:
>
> Not sure about this - (I went a bit back and forth with the javadoc text). An address layout describe an address value, not a memory region. E.g. it describes 64 bits. With a target layout you can say that those 64 bits point to a memory region that has a given layout. It is a bit convoluted to describe.

Gave it another stab - let me know what you think.

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

PR: https://git.openjdk.org/panama-foreign/pull/811


More information about the panama-dev mailing list