aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2017-02-13 15:49:27 -0800
committerGravatar yang-g <yangg@google.com>2017-02-16 09:39:27 -0800
commit6955c5e8d2c881169dfa4ffd80a38182d6e2e14e (patch)
tree02d0b640bf48aa526d21e5ad0d8bdd1f08c3ce5a /include
parentee31910271a72c4e454a9d64ceafa530566388a6 (diff)
Remove code from network_status_tracker.c Pull the hash function to useful.h
Diffstat (limited to 'include')
-rw-r--r--include/grpc/support/useful.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/grpc/support/useful.h b/include/grpc/support/useful.h
index 003e096cf9..9d8314e4be 100644
--- a/include/grpc/support/useful.h
+++ b/include/grpc/support/useful.h
@@ -74,4 +74,7 @@
#define GPR_ICMP(a, b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0))
+#define GPR_HASH_POINTER(x, range) \
+ ((((size_t)x) >> 4) ^ (((size_t)x) >> 9) ^ (((size_t)x) >> 14)) % (range)
+
#endif /* GRPC_SUPPORT_USEFUL_H */