[foreign-memaccess+abi] RFR: 8312615: Ensure jdk_foreign tests pass on linux-x86

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Jul 25 00:59:02 UTC 2023


On Mon, 24 Jul 2023 15:46:09 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Ensure that the jdk_foreign tests pass on linux-x86.
> 
> This is useful to ensure that there are no hard to fix issues (that would require API changes) when trying to use the linker API on a 32-bit platform. This is a good indication that the FFM API is ready for finalization.

test/jdk/java/foreign/NativeTestHelper.java line 129:

> 127:      * The layout for the {@code size_t} C type
> 128:      */
> 129:     public static final ValueLayout C_SIZE_T = ValueLayout.ADDRESS.byteSize() == 8 ? C_LONG_LONG : C_INT;

Can't you set SIZE_T using the canonical layout API?

test/jdk/java/foreign/NativeTestHelper.java line 133:

> 131:     // Common layout shared by some tests
> 132:     // struct S_PDI { void* p0; double p1; int p2; };
> 133:     public static final MemoryLayout S_PDI_LAYOUT = switch ((int) ValueLayout.ADDRESS.byteSize()) {

I don't see differences between the two layouts created in the two cases?

-------------

PR Review Comment: https://git.openjdk.org/panama-foreign/pull/849#discussion_r1272887934
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/849#discussion_r1272888730


More information about the panama-dev mailing list