aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util/memory_counters.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-02-08 15:06:20 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-02-08 15:06:20 -0800
commit8f1b31530c0e6ae01072afb1682ee15ccc191bee (patch)
treec670b34e8efd577369d8b99ae251c65f4ee47b73 /test/core/util/memory_counters.h
parent7dd42bf3d8fefd00603d6f6e502fc286ac721f81 (diff)
Use atomics for memory counters
Avoids two mutex acquisitions per allocation in bm_fullstack (where we also count memory allocations)
Diffstat (limited to 'test/core/util/memory_counters.h')
-rw-r--r--test/core/util/memory_counters.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/core/util/memory_counters.h b/test/core/util/memory_counters.h
index b9b2b3adda..51487c73ce 100644
--- a/test/core/util/memory_counters.h
+++ b/test/core/util/memory_counters.h
@@ -34,13 +34,13 @@
#ifndef GRPC_TEST_CORE_UTIL_MEMORY_COUNTERS_H
#define GRPC_TEST_CORE_UTIL_MEMORY_COUNTERS_H
-#include <stddef.h>
+#include <grpc/support/atm.h>
struct grpc_memory_counters {
- size_t total_size_relative;
- size_t total_size_absolute;
- size_t total_allocs_relative;
- size_t total_allocs_absolute;
+ gpr_atm total_size_relative;
+ gpr_atm total_size_absolute;
+ gpr_atm total_allocs_relative;
+ gpr_atm total_allocs_absolute;
};
void grpc_memory_counters_init();