< prev index next >

src/share/vm/gc/g1/g1Allocator.cpp

Print this page
rev 8867 : imported patch 8067336-allow-that-plab-allocations-at-end-of-regions-are-flexible
rev 8869 : imported patch tom-review
rev 8870 : [mq]: tom-remove-obsolete-comment
rev 8871 : [mq]: mikael-changes

*** 142,153 **** } HeapWord* G1Allocator::par_allocate_during_gc(InCSetState dest, size_t word_size, AllocationContext_t context) { ! size_t temp; ! return par_allocate_during_gc(dest, word_size, word_size, &temp, context); } HeapWord* G1Allocator::par_allocate_during_gc(InCSetState dest, size_t min_word_size, size_t desired_word_size, --- 142,157 ---- } HeapWord* G1Allocator::par_allocate_during_gc(InCSetState dest, size_t word_size, AllocationContext_t context) { ! size_t temp = 0; ! HeapWord* result = par_allocate_during_gc(dest, word_size, word_size, &temp, context); ! assert(result == NULL || temp == word_size, ! err_msg("Requested " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT, ! word_size, temp, p2i(result))); ! return result; } HeapWord* G1Allocator::par_allocate_during_gc(InCSetState dest, size_t min_word_size, size_t desired_word_size,
*** 262,277 **** may_throw_away_buffer(required_in_plab, plab_word_size)) { G1PLAB* alloc_buf = alloc_buffer(dest, context); alloc_buf->retire(); ! size_t actual_plab_size; HeapWord* buf = _allocator->par_allocate_during_gc(dest, required_in_plab, plab_word_size, &actual_plab_size, context); if (buf != NULL) { alloc_buf->set_buf(buf, actual_plab_size); HeapWord* const obj = alloc_buf->allocate(word_sz); assert(obj != NULL, err_msg("PLAB should have been big enough, tried to allocate " --- 266,286 ---- may_throw_away_buffer(required_in_plab, plab_word_size)) { G1PLAB* alloc_buf = alloc_buffer(dest, context); alloc_buf->retire(); ! size_t actual_plab_size = 0; HeapWord* buf = _allocator->par_allocate_during_gc(dest, required_in_plab, plab_word_size, &actual_plab_size, context); + + assert(buf == NULL || ((actual_plab_size >= required_in_plab) && (actual_plab_size <= plab_word_size)), + err_msg("Requested at minimum " SIZE_FORMAT ", desired " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT, + required_in_plab, plab_word_size, actual_plab_size, p2i(buf))); + if (buf != NULL) { alloc_buf->set_buf(buf, actual_plab_size); HeapWord* const obj = alloc_buf->allocate(word_sz); assert(obj != NULL, err_msg("PLAB should have been big enough, tried to allocate "
< prev index next >