diff options
author | dwight <dwight@10gen.com> | 2011-07-11 20:00:54 -0400 |
---|---|---|
committer | dwight <dwight@10gen.com> | 2011-07-11 20:00:54 -0400 |
commit | bac5bc016f1e1c2dc4671ac0599401caf03b2f57 (patch) | |
tree | 23b2a73d3a05e99507eb036f16b6d112be7825f2 /bson | |
parent | f3600a55605bc8a252ed43019df9748cd5add0cc (diff) | |
download | mongo-bac5bc016f1e1c2dc4671ac0599401caf03b2f57.tar.gz |
branch prediction gcc
Diffstat (limited to 'bson')
-rw-r--r-- | bson/inline_decls.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/bson/inline_decls.h b/bson/inline_decls.h index e1f819c0d6c..433a67010cb 100644 --- a/bson/inline_decls.h +++ b/bson/inline_decls.h @@ -34,25 +34,21 @@ /* Note: do not clutter code with these -- ONLY use in hot spots / significant loops. */ -//#if 1 - -//#if !defined(__GNUC__) +#if !defined(__GNUC__) // branch prediction. indicate we expect to enter the if statement body -#define MONGOIF(x) if( (x) ) +# define MONGOIF(x) if( (x) ) // branch prediction. indicate we expect to not enter the if statement body -#define MONGO_IF(x) if( (x) ) +# define MONGO_IF(x) if( (x) ) // prefetch data from memory -#define MONGOPREFETCH(x) { /*just check we compile:*/ assert(sizeof(*x)); } - -#if 0 +# define MONGOPREFETCH(x) { /*just check we compile:*/ assert(sizeof(*x)); } -#define IF(x) if( __builtin_expect((x), 1) ) - -#define _IF(x) if( __builtin_expect((x), 0) ) +#else -#define PREFETCH(x) { /*just check we compile:*/ assert(sizeof(*x)); } +# define MONGOIF(x) if( __builtin_expect((x), 1) ) +# define MONGO_IF(x) if( __builtin_expect((x), 0) ) +# define MONGOPREFETCH(x) { /*just check we compile:*/ assert(sizeof(*x)); } #endif |