8249225: Move definition of PADDING_ELEM_NUM

Reviewed-by: tschatzl, kbarrett
This commit is contained in:
Cesar Soares Lucas 2020-07-24 11:16:05 +02:00 committed by Thomas Schatzl
parent 22006dceb4
commit eaeb43542b
2 changed files with 4 additions and 4 deletions

View File

@ -68,9 +68,11 @@ G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h,
// entries, since entry 0 keeps track of surviving bytes for non-young regions.
// We also add a few elements at the beginning and at the end in
// an attempt to eliminate cache contention
size_t array_length = PADDING_ELEM_NUM + _surviving_words_length + PADDING_ELEM_NUM;
const size_t padding_elem_num = (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t));
size_t array_length = padding_elem_num + _surviving_words_length + padding_elem_num;
_surviving_young_words_base = NEW_C_HEAP_ARRAY(size_t, array_length, mtGC);
_surviving_young_words = _surviving_young_words_base + PADDING_ELEM_NUM;
_surviving_young_words = _surviving_young_words_base + padding_elem_num;
memset(_surviving_young_words, 0, _surviving_words_length * sizeof(size_t));
_plab_allocator = new G1PLABAllocator(_g1h->allocator());

View File

@ -81,8 +81,6 @@ class G1ParScanThreadState : public CHeapObj<mtGC> {
// available for allocation.
bool _old_gen_is_full;
#define PADDING_ELEM_NUM (DEFAULT_CACHE_LINE_SIZE / sizeof(size_t))
G1RedirtyCardsQueue& redirty_cards_queue() { return _rdcq; }
G1CardTable* ct() { return _ct; }