aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-09-11 09:14:57 -0700
committerGravatar Vijay Pai <vpai@google.com>2018-09-11 09:14:57 -0700
commit20778b0c468db746088793da13699dd22c8993e0 (patch)
tree47860ea0dc2799ca4ac93e162f0d305bfcf16126 /src/cpp
parent5474e92292a37ea9017db02da1e8e6aea621b156 (diff)
Address reviewer comments
Diffstat (limited to 'src/cpp')
-rw-r--r--src/cpp/common/callback_common.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cpp/common/callback_common.cc b/src/cpp/common/callback_common.cc
index 68df1166ba..ae47901f1b 100644
--- a/src/cpp/common/callback_common.cc
+++ b/src/cpp/common/callback_common.cc
@@ -34,6 +34,13 @@ class CallbackWithSuccessImpl : public grpc_core::CQCallbackInterface {
assert(size == sizeof(CallbackWithSuccessImpl));
}
+ // This operator should never be called as the memory should be freed as part
+ // of the arena destruction. It only exists to provide a matching operator
+ // delete to the operator new so that some compilers will not complain (see
+ // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
+ // there are no tests catching the compiler warning.
+ static void operator delete(void*, void*) { assert(0); }
+
CallbackWithSuccessImpl(grpc_call* call, CallbackWithSuccessTag* parent,
std::function<void(bool)> f)
: call_(call), parent_(parent), func_(std::move(f)) {
@@ -62,6 +69,13 @@ class CallbackWithStatusImpl : public grpc_core::CQCallbackInterface {
assert(size == sizeof(CallbackWithStatusImpl));
}
+ // This operator should never be called as the memory should be freed as part
+ // of the arena destruction. It only exists to provide a matching operator
+ // delete to the operator new so that some compilers will not complain (see
+ // https://github.com/grpc/grpc/issues/11301) Note at the time of adding this
+ // there are no tests catching the compiler warning.
+ static void operator delete(void*, void*) { assert(0); }
+
CallbackWithStatusImpl(grpc_call* call, CallbackWithStatusTag* parent,
std::function<void(Status)> f)
: call_(call), parent_(parent), func_(std::move(f)), status_() {