aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/error_internal.h
diff options
context:
space:
mode:
authorGravatar Soheil Hassas Yeganeh <soheil@google.com>2018-10-18 15:49:42 -0400
committerGravatar Soheil Hassas Yeganeh <soheil@google.com>2018-10-18 16:04:20 -0400
commit3a9411ca1e733ce9f87b22136014c7a00bdeacbd (patch)
tree4ed040cb14b5ebb39f24837db6d70dc10e5090ff /src/core/lib/iomgr/error_internal.h
parentdfcc96227c6fe1a18068171c988cb0c5f1250f19 (diff)
Optimize error handling for special cases.
This commit contains a few improvements: 1. Using a consequetive range of [0..4], will allow us to merge all branches of error_is_special into one comparison. 2. With (1), we can remove the for loops to find entries in error_status_map with a single O(1) lookup. 3. grpc_error_is_special() code paths should be inlined for ref and unref to avoid callq for the majority of cases where speical error is used. 4. grpc_error_get_int() should never accept a nullptr argument to avoid an expensive branch in the hot path. Callers should all allocate a dummy int on the stack when calling.
Diffstat (limited to 'src/core/lib/iomgr/error_internal.h')
-rw-r--r--src/core/lib/iomgr/error_internal.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/core/lib/iomgr/error_internal.h b/src/core/lib/iomgr/error_internal.h
index 7fde347abd..8027396019 100644
--- a/src/core/lib/iomgr/error_internal.h
+++ b/src/core/lib/iomgr/error_internal.h
@@ -58,6 +58,4 @@ struct grpc_error {
intptr_t arena[0];
};
-bool grpc_error_is_special(struct grpc_error* err);
-
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */