RFR: 8221149: os::malloc checks MallocCatchPtr outside of ifdef ASSERT block
    Stefan Karlsson 
    stefan.karlsson at oracle.com
       
    Thu Mar 28 07:46:56 UTC 2019
    
    
  
Hi all,
Please review this patch to move the MallocCatchPtr check into the ifdef 
ASSERT block, just like the other usages of it.
http://cr.openjdk.java.net/~stefank/8221149/webrev.01/
https://bugs.openjdk.java.net/browse/JDK-8221149
A side note: Is the intention that MallocCatchPtr should find pointers 
to the memory address returned from ::malloc, or the memory address we 
hand out from os::malloc? Currently it's the latter and it's not obvious 
from the the code if this was the intention from the beginning.
  704   // Wrap memory with guard
  705   GuardedMemory guarded(ptr, size + nmt_header_size);
  706   ptr = guarded.get_user_ptr();
  707
  708   if ((intptr_t)ptr == (intptr_t)MallocCatchPtr) {
Thanks,
StefanK
    
    
More information about the hotspot-runtime-dev
mailing list