< prev index next >
src/share/vm/gc/shared/threadLocalAllocBuffer.hpp
Print this page
@@ -57,12 +57,11 @@
unsigned _gc_waste;
unsigned _slow_allocations;
AdaptiveWeightedAverage _allocation_fraction; // fraction of eden allocated in tlabs
- void accumulate_statistics();
- void initialize_statistics();
+ bool _gclab;
void set_start(HeapWord* start) { _start = start; }
void set_end(HeapWord* end) { _end = end; }
void set_top(HeapWord* top) { _top = top; }
void set_pf_top(HeapWord* pf_top) { _pf_top = pf_top; }
@@ -77,13 +76,10 @@
size_t remaining() const { return end() == NULL ? 0 : pointer_delta(hard_end(), top()); }
// Make parsable and release it.
void reset();
- // Resize based on amount of allocation, etc.
- void resize();
-
void invariants() const { assert(top() >= start() && top() <= end(), "invalid tlab"); }
void initialize(HeapWord* start, HeapWord* top, HeapWord* end);
void print_stats(const char* tag);
@@ -123,15 +119,21 @@
size_t refill_waste_limit() const { return _refill_waste_limit; }
// Allocate size HeapWords. The memory is NOT initialized to zero.
inline HeapWord* allocate(size_t size);
+ // Resize based on amount of allocation, etc.
+ void resize();
+
+ void accumulate_statistics();
+ void initialize_statistics();
+
+ // Rolls back a single allocation of the given size.
+ void rollback(size_t size);
+
// Reserve space at the end of TLAB
- static size_t end_reserve() {
- int reserve_size = typeArrayOopDesc::header_size(T_INT);
- return MAX2(reserve_size, VM_Version::reserve_for_allocation_prefetch());
- }
+ static size_t end_reserve();
static size_t alignment_reserve() { return align_object_size(end_reserve()); }
static size_t alignment_reserve_in_bytes() { return alignment_reserve() * HeapWordSize; }
// Return tlab size or remaining space in eden such that the
// space is large enough to hold obj_size and necessary fill space.
@@ -155,11 +157,11 @@
// Resize tlabs for all threads
static void resize_all_tlabs();
void fill(HeapWord* start, HeapWord* top, size_t new_size);
- void initialize();
+ void initialize(bool gclab);
static size_t refill_waste_limit_increment() { return TLABWasteIncrement; }
// Code generation support
static ByteSize start_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _start); }
< prev index next >