RFR: 8311630: [s390] Implementation of Foreign Function & Memory API (Preview) [v2]

sid8606 duke at openjdk.org
Fri Jul 7 14:38:00 UTC 2023


On Fri, 7 Jul 2023 10:32:54 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> sid8606 has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address Amit's review comments
>
> test/jdk/java/foreign/TestClassLoaderFindNative.java line 63:
> 
>> 61:     public void testVariableSymbolLookup() {
>> 62:         MemorySegment segment = SymbolLookup.loaderLookup().find("c").get().reinterpret(ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? 1 : 4);
>> 63:         assertEquals(segment.get(JAVA_BYTE, ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? 0 : 3), 42);
> 
> Could you explain why this is needed? It looks like the lookup is returning the wrong address?

Since  s390x runs in Big Endian mode. We get LSB on higher address of integer size.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14801#discussion_r1255921714


More information about the core-libs-dev mailing list