RFR (XS) 8245722: 32-bit build failures after JDK-8243491

Aleksey Shipilev shade at redhat.com
Mon May 25 12:38:07 UTC 2020


Bug:
  https://bugs.openjdk.java.net/browse/JDK-8245722

This is similar to JDK-8236634, and fix takes the same form:

diff -r d52c2e540934 test/jdk/java/foreign/libNativeAccess.c
--- a/test/jdk/java/foreign/libNativeAccess.c   Mon May 25 12:03:30 2020 +0200
+++ b/test/jdk/java/foreign/libNativeAccess.c   Mon May 25 14:25:49 2020 +0200
@@ -116,12 +116,12 @@
     return (*env)->GetDirectBufferCapacity(env, buf);
 }

 JNIEXPORT jlong JNICALL
 Java_TestNative_allocate(JNIEnv *env, jclass cls, jint size) {
-    return (jlong)malloc(size);
+    return (jlong)(uintptr_t)malloc(size);
 }

 JNIEXPORT void JNICALL
 Java_TestNative_free(JNIEnv *env, jclass cls, jlong ptr) {
-    free((void*) ptr);
+    free((void*)(uintptr_t)ptr);
 }

Testing: {x86_32, x86_64} builds, jdk-submit (running)

-- 
Thanks,
-Aleksey



More information about the core-libs-dev mailing list