8315242: G1: Fix -Wconversion warnings around GCDrainStackTargetSize

Reviewed-by: tschatzl, mli
This commit is contained in:
Albert Mingkun Yang 2023-08-31 09:49:16 +00:00
parent b594f01fe4
commit b0353addf2
4 changed files with 7 additions and 9 deletions

View File

@ -2317,9 +2317,9 @@ void G1CMTask::drain_local_queue(bool partially) {
// Decide what the target size is, depending whether we're going to
// drain it partially (so that other tasks can steal if they run out
// of things to do) or totally (at the very end).
size_t target_size;
uint target_size;
if (partially) {
target_size = MIN2((size_t)_task_queue->max_elems()/3, GCDrainStackTargetSize);
target_size = MIN2(_task_queue->max_elems() / 3, GCDrainStackTargetSize);
} else {
target_size = 0;
}

View File

@ -178,15 +178,13 @@ PSPromotionManager::PSPromotionManager() {
// We set the old lab's start array.
_old_lab.set_start_array(old_gen()->start_array());
uint queue_size;
queue_size = claimed_stack_depth()->max_elems();
uint queue_size = claimed_stack_depth()->max_elems();
if (ParallelGCThreads == 1) {
_target_stack_size = 0;
} else {
// don't let the target stack size to be more than 1/4 of the entries
_target_stack_size = (uint) MIN2((uint) GCDrainStackTargetSize,
(uint) (queue_size / 4));
_target_stack_size = MIN2(GCDrainStackTargetSize, (queue_size / 4));
}
_array_chunk_size = ParGCArrayScanChunk;

View File

@ -684,10 +684,10 @@
develop(uintx, GCExpandToAllocateDelayMillis, 0, \
"Delay between expansion and allocation (in milliseconds)") \
\
product(uintx, GCDrainStackTargetSize, 64, \
product(uint, GCDrainStackTargetSize, 64, \
"Number of entries we will try to leave on the stack " \
"during parallel gc") \
range(0, max_juint) \
range(0, (UINT_MAX - 1) / 2) \
\
product(uint, GCCardSizeInBytes, 512, \
"Card table entry size (in bytes) for card based collectors") \

View File

@ -1044,7 +1044,7 @@ const int badCodeHeapFreeVal = 0xDD; // value used to zap
#define badHeapWord (::badHeapWordVal)
// Default TaskQueue size is 16K (32-bit) or 128K (64-bit)
const size_t TASKQUEUE_SIZE = (NOT_LP64(1<<14) LP64_ONLY(1<<17));
const uint TASKQUEUE_SIZE = (NOT_LP64(1<<14) LP64_ONLY(1<<17));
//----------------------------------------------------------------------------------------------------
// Utility functions for bitfield manipulations