From 25aed5b51d5b10c1acb3713e6858ef589e8a1be2 Mon Sep 17 00:00:00 2001 From: Lei Zaakjyu Date: Tue, 12 Dec 2023 20:20:01 +0800 Subject: [PATCH] use 'append' --- src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp index a4117aca06b32..40860ea08b2bb 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp @@ -91,7 +91,7 @@ jint G1ConcurrentRefineThreadControl::initialize(G1ConcurrentRefine* cr, uint ma if (max_num_threads > 0) { _threads = new(mtGC) GrowableArray(_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; @@ -99,11 +99,11 @@ jint G1ConcurrentRefineThreadControl::initialize(G1ConcurrentRefine* cr, uint ma 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;