summaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-08-11 07:09:35 +0000
committerNick Mathewson <nickm@torproject.org>2006-08-11 07:09:35 +0000
commitffab3b48a82928e0eb36369eee1e3e56bae0020c (patch)
tree3ecde5aa972d100805542cd65f2fc101d713cf87 /src/common/compat.h
parent4eddbcf2626b1394e1eb1a9c3928002bb346e178 (diff)
downloadtor-ffab3b48a82928e0eb36369eee1e3e56bae0020c.tar.gz
tor-ffab3b48a82928e0eb36369eee1e3e56bae0020c.zip
r7326@Kushana: nickm | 2006-08-10 23:50:49 -0700
And another GCC change: predict that tor_frees() are usually real frees, and tor_asserts() usually wont happen. Other test should wait till -fprofile-arcs svn:r7022
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index 853bcd0a06..6e9ec38f01 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -95,11 +95,13 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
#define ATTR_PURE __attribute__((pure))
#define ATTR_MALLOC __attribute__((malloc))
#define ATTR_NONNULL(x) __attribute__((nonnull x))
+#define PREDICT(exp, val) __builtin_expect((exp), (val))
#else
#define ATTR_NORETURN
#define ATTR_PURE
#define ATTR_MALLOC
#define ATTR_NONNULL(x)
+#define PREDICT(exp, val)
#endif
/* ===== String compatibility */