[foreign-memaccess] RFR 8235259: Java layout constants should use native endianness

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Dec 3 19:12:10 UTC 2019


On 03/12/2019 18:49, John Rose wrote:
> Probably an import static
> idiom is sufficient

This is where we're currently at.

MemoryLayouts has various constants inside. It has WORA constants (such 
as BITS_64_BE) as well as internal layouts (such as JAVA_INT - these 
will be moved, eventually, to the corresponding wrapper classes).

The realization is that if we just provide WORA, it is then very hard to 
work with Java arrays - which is a very common case for the API (e.g. 
think about moving data from on-heap to off-heap and back - e.g. to talk 
to a native library).

It's up to the user to decide which constants he/she wants to use. Each 
set of constant has a very different audience in mind - and there's no 
silver bullet.

Maurizio



More information about the panama-dev mailing list