< prev index next >
src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp
Print this page
@@ -43,10 +43,11 @@
HeapWord* _end; // Last allocatable address + 1
HeapWord* _hard_end; // _end + AlignmentReserve
// In support of ergonomic sizing of PLAB's
size_t _allocated; // in HeapWord units
size_t _wasted; // in HeapWord units
+ size_t _undo_wasted;
char tail[32];
static size_t AlignmentReserve;
// Force future allocations to fail and queries for contains()
// to return false. Returns the amount of unused space in this PLAB.
@@ -96,14 +97,21 @@
assert(pointer_delta(_top, _bottom) >= word_sz, "Bad undo");
assert(pointer_delta(_top, obj) == word_sz, "Bad undo");
_top = obj;
}
+ void add_undo_waste(size_t word_sz) {
+ _undo_wasted += word_sz;
+ }
+
// The total (word) size of the buffer, including both allocated and
// unallocated space.
size_t word_sz() { return _word_sz; }
+ size_t wasted() { return _wasted; }
+ size_t undo_wasted() { return _undo_wasted; }
+
// Should only be done if we are about to reset with a new buffer of the
// given size.
void set_word_size(size_t new_word_sz) {
assert(new_word_sz > AlignmentReserve, "Too small");
_word_sz = new_word_sz;
< prev index next >