8203843: BasicParState::default_estimated_thread_count(false) can return 0 in gtest
Summary: Ensure minimum estimated thread count is 1.
Reviewed-by: tschatzl, stuefe, rehn
--- a/src/hotspot/share/gc/shared/oopStorage.cpp Tue May 29 15:50:27 2018 -0400
+++ b/src/hotspot/share/gc/shared/oopStorage.cpp Tue May 29 16:02:23 2018 -0400
@@ -907,7 +907,8 @@
// Parallel iteration support
uint OopStorage::BasicParState::default_estimated_thread_count(bool concurrent) {
- return concurrent ? ConcGCThreads : ParallelGCThreads;
+ uint configured = concurrent ? ConcGCThreads : ParallelGCThreads;
+ return MAX2(1u, configured); // Never estimate zero threads.
}
OopStorage::BasicParState::BasicParState(const OopStorage* storage,