src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

changeset 2073
bb847e31b836
parent 2072
688c3755d7af
child 2074
b63010841f78
equal deleted inserted replaced
2072:688c3755d7af 2073:bb847e31b836
2192 return MIN2(MAX2(cur_alloc_space->free(), (size_t)MinTLABSize), 2192 return MIN2(MAX2(cur_alloc_space->free(), (size_t)MinTLABSize),
2193 max_tlab_size); 2193 max_tlab_size);
2194 } 2194 }
2195 } 2195 }
2196 2196
2197 HeapWord* G1CollectedHeap::allocate_new_tlab(size_t size) { 2197 HeapWord* G1CollectedHeap::allocate_new_tlab(size_t word_size) {
2198 assert(!isHumongous(word_size),
2199 err_msg("a TLAB should not be of humongous size, "
2200 "word_size = "SIZE_FORMAT, word_size));
2198 bool dummy; 2201 bool dummy;
2199 return G1CollectedHeap::mem_allocate(size, false, true, &dummy); 2202 return G1CollectedHeap::mem_allocate(word_size, false, true, &dummy);
2200 } 2203 }
2201 2204
2202 bool G1CollectedHeap::allocs_are_zero_filled() { 2205 bool G1CollectedHeap::allocs_are_zero_filled() {
2203 return false; 2206 return false;
2204 } 2207 }
3637 3640
3638 // *** Parallel G1 Evacuation 3641 // *** Parallel G1 Evacuation
3639 3642
3640 HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose, 3643 HeapWord* G1CollectedHeap::par_allocate_during_gc(GCAllocPurpose purpose,
3641 size_t word_size) { 3644 size_t word_size) {
3645 assert(!isHumongous(word_size),
3646 err_msg("we should not be seeing humongous allocation requests "
3647 "during GC, word_size = "SIZE_FORMAT, word_size));
3648
3642 HeapRegion* alloc_region = _gc_alloc_regions[purpose]; 3649 HeapRegion* alloc_region = _gc_alloc_regions[purpose];
3643 // let the caller handle alloc failure 3650 // let the caller handle alloc failure
3644 if (alloc_region == NULL) return NULL; 3651 if (alloc_region == NULL) return NULL;
3645 3652
3646 HeapWord* block = alloc_region->par_allocate(word_size); 3653 HeapWord* block = alloc_region->par_allocate(word_size);
3669 HeapWord* 3676 HeapWord*
3670 G1CollectedHeap::allocate_during_gc_slow(GCAllocPurpose purpose, 3677 G1CollectedHeap::allocate_during_gc_slow(GCAllocPurpose purpose,
3671 HeapRegion* alloc_region, 3678 HeapRegion* alloc_region,
3672 bool par, 3679 bool par,
3673 size_t word_size) { 3680 size_t word_size) {
3681 assert(!isHumongous(word_size),
3682 err_msg("we should not be seeing humongous allocation requests "
3683 "during GC, word_size = "SIZE_FORMAT, word_size));
3684
3674 HeapWord* block = NULL; 3685 HeapWord* block = NULL;
3675 // In the parallel case, a previous thread to obtain the lock may have 3686 // In the parallel case, a previous thread to obtain the lock may have
3676 // already assigned a new gc_alloc_region. 3687 // already assigned a new gc_alloc_region.
3677 if (alloc_region != _gc_alloc_regions[purpose]) { 3688 if (alloc_region != _gc_alloc_regions[purpose]) {
3678 assert(par, "But should only happen in parallel case."); 3689 assert(par, "But should only happen in parallel case.");

mercurial