mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 05:45:11 +02:00
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:
parent
84ef74286f
commit
fd6487f201
7 changed files with 28 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue