aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar David G. Quintas <dgq@google.com>2015-05-05 16:51:51 -0700
committerGravatar David G. Quintas <dgq@google.com>2015-05-05 16:51:51 -0700
commit234e62ce97d229141d3a1eea28103abbaa3d34d9 (patch)
tree21391adc34b1fe15fdbf5a2d169388aff6c420ab /include
parentfde356c98e4c29148e7d5d0aa561be34235356d9 (diff)
parent80abd54fc1081ea3585b45d63bbd9a5f7612a843 (diff)
Merge pull request #1395 from ctiller/swappy
Optimize a few core routines
Diffstat (limited to 'include')
-rw-r--r--include/grpc/support/useful.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/grpc/support/useful.h b/include/grpc/support/useful.h
index 979f3d026b..e1ce0455c6 100644
--- a/include/grpc/support/useful.h
+++ b/include/grpc/support/useful.h
@@ -45,4 +45,11 @@
#define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array)))
+#define GPR_SWAP(type, a, b) \
+ do { \
+ type x = a; \
+ a = b; \
+ b = x; \
+ } while (0)
+
#endif /* GRPC_SUPPORT_USEFUL_H */