src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp
Print this page
rev 6251 : 8028710: G1 does not retire allocation buffers after reference processing work
Summary: G1 does not retire allocation buffers after reference processing work when -XX:+ParallelRefProcEnabled is enabled.
Reviewed-by:
@@ -58,10 +58,11 @@
public:
// Initializes the buffer to be empty, but with the given "word_sz".
// Must get initialized with "set_buf" for an allocation to succeed.
ParGCAllocBuffer(size_t word_sz);
+ virtual ~ParGCAllocBuffer() {}
static const size_t min_size() {
return ThreadLocalAllocBuffer::min_size();
}
@@ -111,11 +112,11 @@
bool contains(void* addr) {
return (void*)_bottom <= addr && addr < (void*)_hard_end;
}
// Sets the space of the buffer to be [buf, space+word_sz()).
- void set_buf(HeapWord* buf) {
+ virtual void set_buf(HeapWord* buf) {
_bottom = buf;
_top = _bottom;
_hard_end = _bottom + word_sz();
_end = _hard_end - AlignmentReserve;
assert(_end >= _top, "Negative buffer");
@@ -156,11 +157,11 @@
}
// Fills in the unallocated portion of the buffer with a garbage object.
// If "end_of_gc" is TRUE, is after the last use in the GC. IF "retain"
// is true, attempt to re-use the unused portion in the next GC.
- void retire(bool end_of_gc, bool retain);
+ virtual void retire(bool end_of_gc, bool retain);
void print() PRODUCT_RETURN;
};
// PLAB stats book-keeping
@@ -236,18 +237,18 @@
return res;
}
void undo_allocation(HeapWord* obj, size_t word_sz);
- void set_buf(HeapWord* buf_start) {
+ virtual void set_buf(HeapWord* buf_start) {
ParGCAllocBuffer::set_buf(buf_start);
_true_end = _hard_end;
_bt.set_region(MemRegion(buf_start, word_sz()));
_bt.initialize_threshold();
}
- void retire(bool end_of_gc, bool retain);
+ virtual void retire(bool end_of_gc, bool retain);
MemRegion range() {
return MemRegion(_top, _true_end);
}
};