diff options
author | Craig Tiller <ctiller@google.com> | 2017-11-03 09:09:36 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-11-03 09:09:36 -0700 |
commit | baa14a975ef92ee6fb301f0e684f56f18f2c55a7 (patch) | |
tree | 9a6cb2df58fe175e8abfccf2cbd40349726e46f3 /test/core/util/memory_counters.c | |
parent | ef68fe7239a89095f1eaa89c1dd28b2b7be2a3c7 (diff) |
Update clang-format to 5.0
Diffstat (limited to 'test/core/util/memory_counters.c')
-rw-r--r-- | test/core/util/memory_counters.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/core/util/memory_counters.c b/test/core/util/memory_counters.c index 9fb3ffe095..ff85a63803 100644 --- a/test/core/util/memory_counters.c +++ b/test/core/util/memory_counters.c @@ -27,9 +27,9 @@ static struct grpc_memory_counters g_memory_counters; static gpr_allocation_functions g_old_allocs; -static void *guard_malloc(size_t size); -static void *guard_realloc(void *vptr, size_t size); -static void guard_free(void *vptr); +static void* guard_malloc(size_t size); +static void* guard_realloc(void* vptr, size_t size); +static void guard_free(void* vptr); #ifdef GPR_LOW_LEVEL_COUNTERS /* hide these from the microbenchmark atomic stats */ @@ -41,20 +41,20 @@ static void guard_free(void *vptr); #define NO_BARRIER_LOAD(x) gpr_atm_no_barrier_load(x) #endif -static void *guard_malloc(size_t size) { - size_t *ptr; +static void* guard_malloc(size_t size) { + size_t* ptr; if (!size) return NULL; NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_absolute, (gpr_atm)size); NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, (gpr_atm)size); NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_absolute, (gpr_atm)1); NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_relative, (gpr_atm)1); - ptr = (size_t *)g_old_allocs.malloc_fn(size + sizeof(size)); + ptr = (size_t*)g_old_allocs.malloc_fn(size + sizeof(size)); *ptr++ = size; return ptr; } -static void *guard_realloc(void *vptr, size_t size) { - size_t *ptr = (size_t *)vptr; +static void* guard_realloc(void* vptr, size_t size) { + size_t* ptr = (size_t*)vptr; if (vptr == NULL) { return guard_malloc(size); } @@ -67,13 +67,13 @@ static void *guard_realloc(void *vptr, size_t size) { NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, -(gpr_atm)*ptr); NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, (gpr_atm)size); NO_BARRIER_FETCH_ADD(&g_memory_counters.total_allocs_absolute, (gpr_atm)1); - ptr = (size_t *)g_old_allocs.realloc_fn(ptr, size + sizeof(size)); + ptr = (size_t*)g_old_allocs.realloc_fn(ptr, size + sizeof(size)); *ptr++ = size; return ptr; } -static void guard_free(void *vptr) { - size_t *ptr = (size_t *)vptr; +static void guard_free(void* vptr) { + size_t* ptr = (size_t*)vptr; if (!vptr) return; --ptr; NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_relative, -(gpr_atm)*ptr); |