On Thu, 10 Mar 2022 19:35:16 GMT, Jim Laskey <jlas...@openjdk.org> wrote:
>> We propose to provide a runtime anonymous carrier class object generator; >> java.lang.runtime.Carrier. This generator class is designed to share >> anonymous classes when shapes are similar. For example, if several clients >> require objects containing two integer fields, then Carrier will ensure that >> each client generates carrier objects using the same underlying anonymous >> class. >> >> See JBS for details. > > Jim Laskey has updated the pull request incrementally with one additional > commit since the last revision: > > Leave public for the time being src/java.base/share/classes/java/lang/runtime/Carrier.java line 346: > 344: * Carrier for longs and integers. > 345: */ > 346: private final int[] integers; I believe (@rose00 correct me if I'm wrong) that an `int[]` doesn't guarantee proper 64-but alignment of the first element in the array in 32-bit platforms. We ran into similar issues with the MemorySegment API, I believe. I think using a `long[]` if you want explicit 64-bit alignment is the safest choice. ------------- PR: https://git.openjdk.java.net/jdk/pull/7744