aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-07-11 08:11:40 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-07-11 08:11:40 -0700
commit2fe4938401dd306cf79976a9fdf52278b21c178a (patch)
tree09faa78fca0c1750d670c69ee991a5a1aae8b658
parentaca5043ca3b6c2b8970e7bce66884fb856167411 (diff)
Reviewer comments
-rw-r--r--src/core/lib/channel/channelz_registry.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/core/lib/channel/channelz_registry.cc b/src/core/lib/channel/channelz_registry.cc
index d7a595e08f..023ede552a 100644
--- a/src/core/lib/channel/channelz_registry.cc
+++ b/src/core/lib/channel/channelz_registry.cc
@@ -45,23 +45,14 @@ ChannelzRegistry* ChannelzRegistry::Default() {
return g_channelz_registry;
}
-ChannelzRegistry::ChannelzRegistry() {
- gpr_mu_init(&mu_);
- // init elements to nullptr
- memset(entities_.data(), 0, sizeof(void*) * entities_.capacity());
-}
+ChannelzRegistry::ChannelzRegistry() { gpr_mu_init(&mu_); }
-ChannelzRegistry::~ChannelzRegistry() {
- // null out all elements so that the destructors don't try to run.
- // this is a "view only" object.
- memset(entities_.data(), 0, sizeof(void*) * entities_.capacity());
- gpr_mu_destroy(&mu_);
-}
+ChannelzRegistry::~ChannelzRegistry() { gpr_mu_destroy(&mu_); }
void ChannelzRegistry::InternalUnregister(intptr_t uuid) {
GPR_ASSERT(uuid >= 1);
gpr_mu_lock(&mu_);
- GPR_ASSERT((size_t)uuid <= entities_.size());
+ GPR_ASSERT(static_cast<size_t>(uuid) <= entities_.size());
entities_[uuid - 1] = nullptr;
gpr_mu_unlock(&mu_);
}