8203843: BasicParState::default_estimated_thread_count(false) can return 0 in gtest

Ensure minimum estimated thread count is 1.

Reviewed-by: tschatzl, stuefe, rehn
This commit is contained in:
Kim Barrett 2018-05-29 16:02:23 -04:00
parent e3a3941c9a
commit ce8c6887bb

@ -907,7 +907,8 @@ size_t OopStorage::total_memory_usage() const {
// 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,