Mesa (master): gallium: add ALWAYS_INLINE

Luca Barbieri lb at kemper.freedesktop.org
Wed Aug 11 09:29:42 UTC 2010


Module: Mesa
Branch: master
Commit: 6f3c4819ecf397cf9efee0213e628e15c1bc704d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f3c4819ecf397cf9efee0213e628e15c1bc704d

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Tue Aug 10 10:26:14 2010 +0200

gallium: add ALWAYS_INLINE

Used when we want to be sure the compiler inlines a large function into
an inner loop.

---

 src/gallium/include/pipe/p_compiler.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index 0358c14..1fa3ec8 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -102,6 +102,16 @@ typedef unsigned char boolean;
 #  endif
 #endif
 
+/* Forced function inlining */
+#ifndef ALWAYS_INLINE
+#  ifdef __GNUC__
+#    define ALWAYS_INLINE inline __attribute__((always_inline))
+#  elif defined(_MSC_VER)
+#    define ALWAYS_INLINE __forceinline
+#  else
+#    define ALWAYS_INLINE INLINE
+#  endif
+#endif
 
 /* Function visibility */
 #ifndef PUBLIC




More information about the mesa-commit mailing list