Repost: RFR (S) JDK-6311046: -Xcheck:jni should support checking of GetPrimitiveArrayCritical

Zhengyu Gu zhengyu.gu at oracle.com
Thu Jun 5 15:56:58 UTC 2014


src/share/vm/runtime/os.cpp
> old line 743: if (memblock == NULL) {
>     old line 744:   return malloc(size, memflags, (caller == 0 ? 
> CALLER_PC : caller));
>     new line 643: if (memblock == NULL) {
>     new line 644:   return os::malloc(size, memflags, (caller == 0 ? 
> CALLER_PC : caller));
>         Looks like a case where NMT tracking was missing an
>         allocation in non-ASSERT bits if os::realloc() was called
>         with a NULL memblock parameter.
>
>         Nice catch!
>
>     old line 754: void* ptr = malloc(size, memflags, caller == 0 ? 
> CALLER_PC : caller);
>     new line 656: void* ptr = os::malloc(size, memflags, caller == 0 ? 
> CALLER_PC : caller);
>     old line 764: free(memblock);
>     new line 669: os::free(memblock);
>         And again. You should run these by Zhengyu so he can
>         sanity check that this wasn't intentional and make sure
>         that NMT2 has the same fix.
>
It is not a problem, just not as clear as new ones. This part of code is 
in os::realloc(), where os::malloc() takes precedence over ::malloc(), 
besides ::malloc() does not have compatible function signature.


-Zhengyu.


More information about the hotspot-runtime-dev mailing list