[foreign-memaccess] RFR 8228588: MemoryHandles.varHandle still uses implicit platform endiannes

Jorn Vernee jbvernee at xs4all.nl
Wed Jul 24 18:52:35 UTC 2019


Looks good!

For byte carriers (or maybe all carriers) maybe we could provide a 
VarHandle constant in the MemoryHandle class as well?

     public static final VarHandle BYTE = varHandle(byte.class, 
ByteOrder.BIG_ENDIAN); // byte order doesn't really matter here

Jorn

On 2019-07-24 19:18, Maurizio Cimadamore wrote:
> Hi,
> in a recent push we removed all implicit endianness from the various
> factories. Now either you go through a factory and provide explicit
> endianness or you pick one of the predefined layout constants.
> 
> I noted that one part of the API (MemoryHandles::varHandle) was still
> using implicit endianness (and then internally using
> ByteOrder.nativeOrder()).
> 
> This patch gets rid of that:
> 
> http://cr.openjdk.java.net/~mcimadamore/panama/8228588/
> 
> Now, this makes it a bit more cumbersome when working with 'byte'
> carriers, where ByteOrder doesn't really apply - but I don't think
> there's a lot we can do about that.
> 
> Maurizio


More information about the panama-dev mailing list