comparison src/share/vm/code/nmethod.cpp @ 2353:1c0cf339481b

7025742: Can not use CodeCache::unallocated_capacity() with fragmented CodeCache Summary: Use largest_free_block() instead of unallocated_capacity(). Reviewed-by: iveresov, never, ysr
author kvn
date Wed, 09 Mar 2011 09:15:16 -0800
parents 4cd9add59b1e
children fc5ebbb2d1a8
comparison
equal deleted inserted replaced
2352:425688247f3d 2353:1c0cf339481b
760 } 760 }
761 #endif // def HAVE_DTRACE_H 761 #endif // def HAVE_DTRACE_H
762 762
763 void* nmethod::operator new(size_t size, int nmethod_size) { 763 void* nmethod::operator new(size_t size, int nmethod_size) {
764 // Always leave some room in the CodeCache for I2C/C2I adapters 764 // Always leave some room in the CodeCache for I2C/C2I adapters
765 if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) return NULL; 765 if (CodeCache::largest_free_block() < CodeCacheMinimumFreeSpace) return NULL;
766 return CodeCache::allocate(nmethod_size); 766 return CodeCache::allocate(nmethod_size);
767 } 767 }
768 768
769 769
770 nmethod::nmethod( 770 nmethod::nmethod(