Changeset 3516e7ae3f4df445e780bee77b2a9a7f6ce7ddb8

Show
Ignore:
Timestamp:
04/28/08 09:19:16 (8 months ago)
Author:
krayouva <krayouva@…>
Parents:
08b306ad3b952ec99117ba23c795ddb6c733ae52
Children:
ed4cf588b31c5ebb50b4d502802d243fec2cb338
git-committer:
krayouva <krayouva@gmail.com> / 2008-04-27T19:19:16Z-0400
Message:

* Added likely/unlikely branch prediction hints

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • c/include/global.h

    r495f45 r3516e7  
    1313#include <stdarg.h> 
    1414#include <assert.h> 
     15#include <string.h> 
    1516 
    1617#define FRT_MAX_WORD_SIZE 255 
     
    2425#endif 
    2526 
    26 /* This version error out if it can't inline the function */ 
    2727#if __GNUC__ >= 3 
    2828#  define FRT_ALWAYS_INLINE inline __attribute__ ((always_inline)) 
     29#  define likely(x)   __builtin_expect(!!(x), 1) 
     30#  define unlikely(x) __builtin_expect(!!(x), 0) 
    2931#else 
    3032#  define FRT_ALWAYS_INLINE 
     33#  define likely(x)   (x) 
     34#  define unlikely(x) (x) 
    3135#endif 
    3236