aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util/memory_counters.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-11-10 14:14:17 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-11-10 14:14:17 -0800
commit4ac2b8e585cbf7064f9bdde4eabaf8ff42801142 (patch)
tree5379629b43d287972916a87637a26251c1b0de5f /test/core/util/memory_counters.cc
parente77b3c36d1b3e2033abd19d553748b678c22253f (diff)
Enable clang-tidy as a sanity check, fix up all known failures
Diffstat (limited to 'test/core/util/memory_counters.cc')
-rw-r--r--test/core/util/memory_counters.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/core/util/memory_counters.cc b/test/core/util/memory_counters.cc
index ff85a63803..32d7b89c9a 100644
--- a/test/core/util/memory_counters.cc
+++ b/test/core/util/memory_counters.cc
@@ -43,7 +43,7 @@ static void guard_free(void* vptr);
static void* guard_malloc(size_t size) {
size_t* ptr;
- if (!size) return NULL;
+ if (!size) return nullptr;
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);
@@ -55,12 +55,12 @@ static void* guard_malloc(size_t size) {
static void* guard_realloc(void* vptr, size_t size) {
size_t* ptr = (size_t*)vptr;
- if (vptr == NULL) {
+ if (vptr == nullptr) {
return guard_malloc(size);
}
if (size == 0) {
guard_free(vptr);
- return NULL;
+ return nullptr;
}
--ptr;
NO_BARRIER_FETCH_ADD(&g_memory_counters.total_size_absolute, (gpr_atm)size);
@@ -81,7 +81,7 @@ static void guard_free(void* vptr) {
g_old_allocs.free_fn(ptr);
}
-struct gpr_allocation_functions g_guard_allocs = {guard_malloc, NULL,
+struct gpr_allocation_functions g_guard_allocs = {guard_malloc, nullptr,
guard_realloc, guard_free};
void grpc_memory_counters_init() {