diff 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
line wrap: on
line diff
--- a/src/share/vm/code/nmethod.cpp	Sun Mar 06 22:09:23 2011 -0800
+++ b/src/share/vm/code/nmethod.cpp	Wed Mar 09 09:15:16 2011 -0800
@@ -762,7 +762,7 @@
 
 void* nmethod::operator new(size_t size, int nmethod_size) {
   // Always leave some room in the CodeCache for I2C/C2I adapters
-  if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) return NULL;
+  if (CodeCache::largest_free_block() < CodeCacheMinimumFreeSpace) return NULL;
   return CodeCache::allocate(nmethod_size);
 }