248 assert(alloc_buffer(dest, context)->contains(obj + word_sz - 1),
249 "should contain whole object");
250 alloc_buffer(dest, context)->undo_allocation(obj, word_sz);
251 } else {
252 CollectedHeap::fill_with_object(obj, word_sz);
253 add_to_undo_waste(word_sz);
254 }
255 }
256 };
257
258 class G1DefaultParGCAllocator : public G1ParGCAllocator {
259 G1ParGCAllocBuffer _surviving_alloc_buffer;
260 G1ParGCAllocBuffer _tenured_alloc_buffer;
261 G1ParGCAllocBuffer* _alloc_buffers[InCSetState::Num];
262
263 public:
264 G1DefaultParGCAllocator(G1CollectedHeap* g1h);
265
266 virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) {
267 assert(dest.is_valid(),
268 err_msg("Allocation buffer index out-of-bounds: %d", dest.value()));
269 assert(_alloc_buffers[dest.value()] != NULL,
270 err_msg("Allocation buffer is NULL: %d", dest.value()));
271 return _alloc_buffers[dest.value()];
272 }
273
274 virtual void retire_alloc_buffers() ;
275 };
276
277 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCATOR_HPP
|
248 assert(alloc_buffer(dest, context)->contains(obj + word_sz - 1),
249 "should contain whole object");
250 alloc_buffer(dest, context)->undo_allocation(obj, word_sz);
251 } else {
252 CollectedHeap::fill_with_object(obj, word_sz);
253 add_to_undo_waste(word_sz);
254 }
255 }
256 };
257
258 class G1DefaultParGCAllocator : public G1ParGCAllocator {
259 G1ParGCAllocBuffer _surviving_alloc_buffer;
260 G1ParGCAllocBuffer _tenured_alloc_buffer;
261 G1ParGCAllocBuffer* _alloc_buffers[InCSetState::Num];
262
263 public:
264 G1DefaultParGCAllocator(G1CollectedHeap* g1h);
265
266 virtual G1ParGCAllocBuffer* alloc_buffer(InCSetState dest, AllocationContext_t context) {
267 assert(dest.is_valid(),
268 err_msg("Allocation buffer index out-of-bounds: " CSETSTATE_FORMAT, dest.value()));
269 assert(_alloc_buffers[dest.value()] != NULL,
270 err_msg("Allocation buffer is NULL: " CSETSTATE_FORMAT, dest.value()));
271 return _alloc_buffers[dest.value()];
272 }
273
274 virtual void retire_alloc_buffers() ;
275 };
276
277 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCATOR_HPP
|