7025742: Can not use CodeCache::unallocated_capacity() with fragmented CodeCache

Use largest_free_block() instead of unallocated_capacity().

Reviewed-by: iveresov, never, ysr
This commit is contained in:
Vladimir Kozlov 2011-03-09 09:15:16 -08:00
parent 84ef74286f
commit fd6487f201
7 changed files with 28 additions and 15 deletions

View file

@ -762,7 +762,7 @@ nmethod::nmethod(
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);
}