//Be very careful with some of these.
//Their use is described at
//http://blog.rlove.org/2005_10_01_archive.html

#ifndef WIESE_GCC_HINTS_HPP_20080627_212254_0700_1214626974
#define WIESE_GCC_HINTS_HPP_20080627_212254_0700_1214626974


//Primarily, likely and unlikely are often used.

#if __GNUC__ >= 3
# define ___always_inline		inline __attribute__ ((always_inline))
# define likely(x)	__builtin_expect (!!(x), 1)
# define unlikely(x)	__builtin_expect (!!(x), 0)
#else
# define ___always_inline	inline	/* inline when possible */
# define likely(x)	(x)
# define unlikely(x)	(x)
#endif

//Cool new optimizing things for GNU compiler collection 4.3 and later
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
/*For functions that are hotspots (i.e. called a lot and should be
 *  more agressively optimized for speed) vs functions that are cold
 *  and should be optimized for space over speed.  This also affects
 *  where the functions are stored in the final binary, to try to hit
 *  the cache more often (i.e. cold functions are pushed away from
 *  everything else, while hot functions are clustered together.)
 */
#define __hot__ __attribute__((hot))
#define __cold__ __attribute__((cold))
#else
#define __hot__ 
#define __cold__
#endif

#endif
