Oredering of fields in inline types and records

Remi Forax forax at univ-mlv.fr
Fri Mar 6 17:00:40 UTC 2020


----- Mail original -----
> De: "Stephen Colebourne" <scolebourne at joda.org>
> À: "valhalla-dev" <valhalla-dev at openjdk.java.net>
> Envoyé: Vendredi 6 Mars 2020 17:53:37
> Objet: Oredering of fields in inline types and records

> In a normal class with multiple fields, my understanding is that the
> JVM is free to layout the fields in memory however it wishes,
> potentially to make them better align with the underlying
> architecture. ie. it is not constrained to lay them out in source code
> order.
> 
> Does the JVM still have this flexibility with records?

yes

> 
> Will the JVM still have this flexibility with inline types?

yes

> 
> (I don't remember seeing this discussed/answered before, but I could be wrong!)

if as a developer you want to control the layout, yopu can use the foreign memory API of panama.

> thanks
> Stephen

cheers,
Rémi



More information about the valhalla-dev mailing list