comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 14192:ff355e26c78d

8029524: Remove unsused method CollectedHeap::unsafe_max_alloc() Reviewed-by: pliden, jmasa
author brutisso
date Mon, 16 Dec 2013 08:54:14 +0100
parents 86e6d691f2e1
children 893ce66f7473
comparison
equal deleted inserted replaced
14174:050a626a8895 14192:ff355e26c78d
2374 SumUsedClosure blk; 2374 SumUsedClosure blk;
2375 heap_region_iterate(&blk); 2375 heap_region_iterate(&blk);
2376 return blk.result(); 2376 return blk.result();
2377 } 2377 }
2378 2378
2379 size_t G1CollectedHeap::unsafe_max_alloc() {
2380 if (free_regions() > 0) return HeapRegion::GrainBytes;
2381 // otherwise, is there space in the current allocation region?
2382
2383 // We need to store the current allocation region in a local variable
2384 // here. The problem is that this method doesn't take any locks and
2385 // there may be other threads which overwrite the current allocation
2386 // region field. attempt_allocation(), for example, sets it to NULL
2387 // and this can happen *after* the NULL check here but before the call
2388 // to free(), resulting in a SIGSEGV. Note that this doesn't appear
2389 // to be a problem in the optimized build, since the two loads of the
2390 // current allocation region field are optimized away.
2391 HeapRegion* hr = _mutator_alloc_region.get();
2392 if (hr == NULL) {
2393 return 0;
2394 }
2395 return hr->free();
2396 }
2397
2398 bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) { 2379 bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
2399 switch (cause) { 2380 switch (cause) {
2400 case GCCause::_gc_locker: return GCLockerInvokesConcurrent; 2381 case GCCause::_gc_locker: return GCLockerInvokesConcurrent;
2401 case GCCause::_java_lang_system_gc: return ExplicitGCInvokesConcurrent; 2382 case GCCause::_java_lang_system_gc: return ExplicitGCInvokesConcurrent;
2402 case GCCause::_g1_humongous_allocation: return true; 2383 case GCCause::_g1_humongous_allocation: return true;