Oredering of fields in inline types and records

Stephen Colebourne scolebourne at joda.org
Fri Mar 6 16:53:37 UTC 2020


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?

Will the JVM still have this flexibility with inline types?

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


More information about the valhalla-dev mailing list