aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Soheil Hassas Yeganeh <soheil@google.com>2018-09-25 22:02:03 -0400
committerGravatar Soheil Hassas Yeganeh <soheil@google.com>2018-09-25 22:02:03 -0400
commit0535f659f73e6f0073782691b2afa03ca6e6970f (patch)
tree9620d047b3801b023946e651e028d0b59bef0a27 /src/core
parenta68ebc7cfde360fc904b99017702e8eedc251277 (diff)
Set a minimum bound of 1 for the number of timer shards.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lib/iomgr/timer_generic.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/timer_generic.cc b/src/core/lib/iomgr/timer_generic.cc
index aeadd10b68..aba5539199 100644
--- a/src/core/lib/iomgr/timer_generic.cc
+++ b/src/core/lib/iomgr/timer_generic.cc
@@ -256,7 +256,7 @@ static grpc_millis compute_min_deadline(timer_shard* shard) {
static void timer_list_init() {
uint32_t i;
- g_num_shards = GPR_MIN(32, 2 * gpr_cpu_num_cores());
+ g_num_shards = GPR_CLAMP(2 * gpr_cpu_num_cores(), 1, 32);
g_shards =
static_cast<timer_shard*>(gpr_zalloc(g_num_shards * sizeof(*g_shards)));
g_shard_queue = static_cast<timer_shard**>(