mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8009026: [parfait] Null pointer deference in hotspot/src/share/vm/code/nmethod.cpp
Add guarantee() to nmethod constructor and checks to ensure CodeCache has space before allocation Reviewed-by: kvn
This commit is contained in:
parent
69a1275cf2
commit
981e9c35c9
2 changed files with 35 additions and 24 deletions
|
@ -156,6 +156,11 @@ class CodeCache : AllStatic {
|
|||
static address low_bound() { return (address) _heap->low_boundary(); }
|
||||
static address high_bound() { return (address) _heap->high_boundary(); }
|
||||
|
||||
static bool has_space(int size) {
|
||||
// Always leave some room in the CodeCache for I2C/C2I adapters
|
||||
return largest_free_block() > (CodeCacheMinimumFreeSpace + size);
|
||||
}
|
||||
|
||||
// Profiling
|
||||
static address first_address(); // first address used for CodeBlobs
|
||||
static address last_address(); // last address used for CodeBlobs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue