From 24b6d7194f85892f09c7104924ce607ff231af6f Mon Sep 17 00:00:00 2001 From: Soheil Hassas Yeganeh Date: Thu, 18 Oct 2018 16:37:07 -0400 Subject: [PATCH] Add comment for grpc_error_get_int(). Explain that the input parameter cannot be nullptr. --- src/core/lib/iomgr/error.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index 6978ef6d91e..cb740d5b01c 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -194,6 +194,8 @@ inline void grpc_error_unref(grpc_error* err) { grpc_error* grpc_error_set_int(grpc_error* src, grpc_error_ints which, intptr_t value) GRPC_MUST_USE_RESULT; +/// It is an error to pass nullptr as `p`. Caller should allocate a dummy +/// intptr_t for `p`, even if the value of `p` is not used. bool grpc_error_get_int(grpc_error* error, grpc_error_ints which, intptr_t* p); /// This call takes ownership of the slice; the error is responsible for /// eventually unref-ing it.