src/share/vm/code/codeCache.cpp

changeset 2739
527977d4f740
parent 2658
c7f3d0b4570f
child 2745
3f49d30f8184
     1.1 --- a/src/share/vm/code/codeCache.cpp	Tue Apr 05 02:31:46 2011 -0700
     1.2 +++ b/src/share/vm/code/codeCache.cpp	Tue Apr 05 19:16:52 2011 -0700
     1.3 @@ -964,3 +964,14 @@
     1.4              nof_blobs(), nof_nmethods(), nof_adapters(),
     1.5              unallocated_capacity(), largest_free_block());
     1.6  }
     1.7 +
     1.8 +size_t CodeCache::largest_free_block() {
     1.9 +  // This is called both with and without CodeCache_lock held so
    1.10 +  // handle both cases.
    1.11 +  if (CodeCache_lock->owned_by_self()) {
    1.12 +    return _heap->largest_free_block();
    1.13 +  } else {
    1.14 +    MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
    1.15 +    return _heap->largest_free_block();
    1.16 +  }
    1.17 +}

mercurial