Skip to content
Permalink
Browse files
8257162: Initialize ThreadLocalAllocBuffer members
Reviewed-by: shade, ayang, sjohanss, pliden
  • Loading branch information
Thomas Schatzl committed Nov 30, 2020
1 parent 337d7bc commit 962f7a3bae934607cac13480dc2ba2fd790f5cc3
Showing 2 changed files with 22 additions and 4 deletions.
@@ -37,6 +37,27 @@ size_t ThreadLocalAllocBuffer::_max_size = 0;
int ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch = 0;
unsigned int ThreadLocalAllocBuffer::_target_refills = 0;

ThreadLocalAllocBuffer::ThreadLocalAllocBuffer() :
_start(NULL),
_top(NULL),
_pf_top(NULL),
_end(NULL),
_allocation_end(NULL),
_desired_size(0),
_refill_waste_limit(0),
_allocated_before_last_gc(0),
_bytes_since_last_sample_point(0),
_number_of_refills(0),
_fast_refill_waste(0),
_slow_refill_waste(0),
_gc_waste(0),
_slow_allocations(0),
_allocated_size(0),
_allocation_fraction(TLABAllocationWeight) {

// do nothing. TLABs must be inited by initialize() calls
}

size_t ThreadLocalAllocBuffer::remaining() {
if (end() == NULL) {
return 0;
@@ -111,10 +111,7 @@ class ThreadLocalAllocBuffer: public CHeapObj<mtThread> {
int slow_allocations() const { return _slow_allocations; }

public:
ThreadLocalAllocBuffer() : _allocated_before_last_gc(0), _bytes_since_last_sample_point(0),
_allocation_fraction(TLABAllocationWeight) {
// do nothing. tlabs must be inited by initialize() calls
}
ThreadLocalAllocBuffer();

static size_t min_size() { return align_object_size(MinTLABSize / HeapWordSize) + alignment_reserve(); }
static size_t max_size() { assert(_max_size != 0, "max_size not set up"); return _max_size; }

1 comment on commit 962f7a3

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 962f7a3 Nov 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.