From 2fe4938401dd306cf79976a9fdf52278b21c178a Mon Sep 17 00:00:00 2001 From: ncteisen Date: Wed, 11 Jul 2018 08:11:40 -0700 Subject: Reviewer comments --- src/core/lib/channel/channelz_registry.cc | 15 +++------------ 1 file 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(uuid) <= entities_.size()); entities_[uuid - 1] = nullptr; gpr_mu_unlock(&mu_); } -- cgit v1.2.3