Skip to content

Commit 962f7a3

Browse files
author
Thomas Schatzl
committedNov 30, 2020
8257162: Initialize ThreadLocalAllocBuffer members
Reviewed-by: shade, ayang, sjohanss, pliden
1 parent 337d7bc commit 962f7a3

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed
 

‎src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@ size_t ThreadLocalAllocBuffer::_max_size = 0;
3737
int ThreadLocalAllocBuffer::_reserve_for_allocation_prefetch = 0;
3838
unsigned int ThreadLocalAllocBuffer::_target_refills = 0;
3939

40+
ThreadLocalAllocBuffer::ThreadLocalAllocBuffer() :
41+
_start(NULL),
42+
_top(NULL),
43+
_pf_top(NULL),
44+
_end(NULL),
45+
_allocation_end(NULL),
46+
_desired_size(0),
47+
_refill_waste_limit(0),
48+
_allocated_before_last_gc(0),
49+
_bytes_since_last_sample_point(0),
50+
_number_of_refills(0),
51+
_fast_refill_waste(0),
52+
_slow_refill_waste(0),
53+
_gc_waste(0),
54+
_slow_allocations(0),
55+
_allocated_size(0),
56+
_allocation_fraction(TLABAllocationWeight) {
57+
58+
// do nothing. TLABs must be inited by initialize() calls
59+
}
60+
4061
size_t ThreadLocalAllocBuffer::remaining() {
4162
if (end() == NULL) {
4263
return 0;

‎src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ class ThreadLocalAllocBuffer: public CHeapObj<mtThread> {
111111
int slow_allocations() const { return _slow_allocations; }
112112

113113
public:
114-
ThreadLocalAllocBuffer() : _allocated_before_last_gc(0), _bytes_since_last_sample_point(0),
115-
_allocation_fraction(TLABAllocationWeight) {
116-
// do nothing. tlabs must be inited by initialize() calls
117-
}
114+
ThreadLocalAllocBuffer();
118115

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

0 commit comments

Comments
 (0)
Please sign in to comment.