From 897a7529e17e536aa2d2e644f71866efd9c4923c Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 31 Jul 2017 11:48:06 -0700 Subject: [PATCH 1/2] Initialize initiating_exec_ctx_or_null --- src/core/lib/iomgr/combiner.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/lib/iomgr/combiner.c b/src/core/lib/iomgr/combiner.c index c72c37e2b53..eead432e3ea 100644 --- a/src/core/lib/iomgr/combiner.c +++ b/src/core/lib/iomgr/combiner.c @@ -79,6 +79,7 @@ grpc_combiner *grpc_combiner_create(void) { lock->time_to_execute_final_list = false; lock->scheduler.vtable = &scheduler; lock->finally_scheduler.vtable = &finally_scheduler; + lock->initiating_exec_ctx_or_null = 0; gpr_atm_no_barrier_store(&lock->state, STATE_UNORPHANED); gpr_mpscq_init(&lock->queue); grpc_closure_list_init(&lock->final_list); From 84d6924fa0cd28ffde1ada52fa4be7426a08149c Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 31 Jul 2017 13:39:09 -0700 Subject: [PATCH 2/2] Use zalloc and remove now redundant sets --- src/core/lib/iomgr/combiner.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/lib/iomgr/combiner.c b/src/core/lib/iomgr/combiner.c index eead432e3ea..9b66987b685 100644 --- a/src/core/lib/iomgr/combiner.c +++ b/src/core/lib/iomgr/combiner.c @@ -73,13 +73,10 @@ static const grpc_closure_scheduler_vtable finally_scheduler = { static void offload(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error); grpc_combiner *grpc_combiner_create(void) { - grpc_combiner *lock = gpr_malloc(sizeof(*lock)); + grpc_combiner *lock = gpr_zalloc(sizeof(*lock)); gpr_ref_init(&lock->refs, 1); - lock->next_combiner_on_this_exec_ctx = NULL; - lock->time_to_execute_final_list = false; lock->scheduler.vtable = &scheduler; lock->finally_scheduler.vtable = &finally_scheduler; - lock->initiating_exec_ctx_or_null = 0; gpr_atm_no_barrier_store(&lock->state, STATE_UNORPHANED); gpr_mpscq_init(&lock->queue); grpc_closure_list_init(&lock->final_list);