Skip to content

Commit

Permalink
use 'append'
Browse files Browse the repository at this point in the history
  • Loading branch information
LizBing committed Dec 12, 2023
1 parent 42d3f53 commit 25aed5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ jint G1ConcurrentRefineThreadControl::initialize(G1ConcurrentRefine* cr, uint ma
if (max_num_threads > 0) {
_threads = new(mtGC) GrowableArray<G1ConcurrentRefineThread*>(_max_num_threads, mtGC);

_threads->at(0) = create_refinement_thread(0, true);
_threads->append(create_refinement_thread(0, true));
if (_threads->at(0) == nullptr) {
vm_shutdown_during_initialization("Could not allocate primary refinement thread");
return JNI_ENOMEM;
}

if (UseDynamicNumberOfGCThreads) {
for (uint i = 1; i < max_num_threads; ++i) {
_threads->at(i) = nullptr;
_threads->append(nullptr);
}
} else {
for (uint i = 1; i < max_num_threads; ++i) {
_threads->at(i) = create_refinement_thread(i, true);
_threads->append(create_refinement_thread(i, true));
if (_threads->at(i) == nullptr) {
vm_shutdown_during_initialization("Could not allocate refinement threads.");
return JNI_ENOMEM;
Expand Down

0 comments on commit 25aed5b

Please sign in to comment.