From baa14a975ef92ee6fb301f0e684f56f18f2c55a7 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 3 Nov 2017 09:09:36 -0700 Subject: Update clang-format to 5.0 --- src/core/lib/iomgr/iomgr.cc | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'src/core/lib/iomgr/iomgr.cc') diff --git a/src/core/lib/iomgr/iomgr.cc b/src/core/lib/iomgr/iomgr.cc index d6a5b4a76c..86ea08e901 100644 --- a/src/core/lib/iomgr/iomgr.cc +++ b/src/core/lib/iomgr/iomgr.cc @@ -45,7 +45,7 @@ static gpr_cv g_rcv; static int g_shutdown; static grpc_iomgr_object g_root_object; -void grpc_iomgr_init(grpc_exec_ctx *exec_ctx) { +void grpc_iomgr_init(grpc_exec_ctx* exec_ctx) { g_shutdown = 0; gpr_mu_init(&g_mu); gpr_cv_init(&g_rcv); @@ -53,15 +53,15 @@ void grpc_iomgr_init(grpc_exec_ctx *exec_ctx) { grpc_executor_init(exec_ctx); grpc_timer_list_init(exec_ctx); g_root_object.next = g_root_object.prev = &g_root_object; - g_root_object.name = (char *)"root"; + g_root_object.name = (char*)"root"; grpc_network_status_init(); grpc_iomgr_platform_init(); } -void grpc_iomgr_start(grpc_exec_ctx *exec_ctx) { grpc_timer_manager_init(); } +void grpc_iomgr_start(grpc_exec_ctx* exec_ctx) { grpc_timer_manager_init(); } static size_t count_objects(void) { - grpc_iomgr_object *obj; + grpc_iomgr_object* obj; size_t n = 0; for (obj = g_root_object.next; obj != &g_root_object; obj = obj->next) { n++; @@ -69,14 +69,14 @@ static size_t count_objects(void) { return n; } -static void dump_objects(const char *kind) { - grpc_iomgr_object *obj; +static void dump_objects(const char* kind) { + grpc_iomgr_object* obj; for (obj = g_root_object.next; obj != &g_root_object; obj = obj->next) { gpr_log(GPR_DEBUG, "%s OBJECT: %s %p", kind, obj->name, obj); } } -void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx) { +void grpc_iomgr_shutdown(grpc_exec_ctx* exec_ctx) { gpr_timespec shutdown_deadline = gpr_time_add( gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(10, GPR_TIMESPAN)); gpr_timespec last_warning_time = gpr_now(GPR_CLOCK_REALTIME); @@ -109,9 +109,10 @@ void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx) { } if (g_root_object.next != &g_root_object) { if (grpc_iomgr_abort_on_leaks()) { - gpr_log(GPR_DEBUG, "Failed to free %" PRIuPTR - " iomgr objects before shutdown deadline: " - "memory leaks are likely", + gpr_log(GPR_DEBUG, + "Failed to free %" PRIuPTR + " iomgr objects before shutdown deadline: " + "memory leaks are likely", count_objects()); dump_objects("LEAKED"); abort(); @@ -121,9 +122,10 @@ void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx) { if (gpr_cv_wait(&g_rcv, &g_mu, short_deadline)) { if (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), shutdown_deadline) > 0) { if (g_root_object.next != &g_root_object) { - gpr_log(GPR_DEBUG, "Failed to free %" PRIuPTR - " iomgr objects before shutdown deadline: " - "memory leaks are likely", + gpr_log(GPR_DEBUG, + "Failed to free %" PRIuPTR + " iomgr objects before shutdown deadline: " + "memory leaks are likely", count_objects()); dump_objects("LEAKED"); } @@ -148,7 +150,7 @@ void grpc_iomgr_shutdown(grpc_exec_ctx *exec_ctx) { gpr_cv_destroy(&g_rcv); } -void grpc_iomgr_register_object(grpc_iomgr_object *obj, const char *name) { +void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name) { obj->name = gpr_strdup(name); gpr_mu_lock(&g_mu); obj->next = &g_root_object; @@ -157,7 +159,7 @@ void grpc_iomgr_register_object(grpc_iomgr_object *obj, const char *name) { gpr_mu_unlock(&g_mu); } -void grpc_iomgr_unregister_object(grpc_iomgr_object *obj) { +void grpc_iomgr_unregister_object(grpc_iomgr_object* obj) { gpr_mu_lock(&g_mu); obj->next->prev = obj->prev; obj->prev->next = obj->next; @@ -167,7 +169,7 @@ void grpc_iomgr_unregister_object(grpc_iomgr_object *obj) { } bool grpc_iomgr_abort_on_leaks(void) { - char *env = gpr_getenv("GRPC_ABORT_ON_LEAKS"); + char* env = gpr_getenv("GRPC_ABORT_ON_LEAKS"); bool should_we = gpr_is_true(env); gpr_free(env); return should_we; -- cgit v1.2.3