RFR: JDK-8297523 : Various GetPrimitiveArrayCritical miss result - NULL check

Matthias Baesken mbaesken at openjdk.org
Fri Nov 25 13:39:06 UTC 2022


On Fri, 25 Nov 2022 13:09:27 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> Hi Matthias,
> 
> But all this is just theoretical, right, since GPAC does not allocate memory in hotspot? Your patch is fine, though I would prefer OOMEs instead of silently omitting code.
> 
> Cheers, Thomas

Hi Thomas, from what I see in Hotspot  (src/hotspot/share/prims/jni.cpp)  ,  
2815  JNI_ENTRY(void*, jni_GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean *isCopy))
2816   HOTSPOT_JNI_GETPRIMITIVEARRAYCRITICAL_ENTRY(env, array, (uintptr_t *) isCopy);
2817    if (isCopy != NULL) {
2818      *isCopy = JNI_FALSE;
2819    }

isCopy is always set to JNI_FALSE (in case the copy-related parameter is not NULL. So I think your observation about memory allocation is correct.

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

PR: https://git.openjdk.org/jdk/pull/11361



More information about the client-libs-dev mailing list