Bug 863116 - MOZ_ALWAYS_INLINE should not inline in debug builds (r=Waldo)

This commit is contained in:
Bill McCloskey 2013-04-19 10:55:34 -07:00
parent 2c5adb4cb1
commit 6b96448f68
2 changed files with 13 additions and 4 deletions

View File

@ -40,8 +40,8 @@
#endif
#if defined(MOZ_ALWAYS_INLINE)
# define MOZALLOC_INLINE MOZ_ALWAYS_INLINE
#if defined(MOZ_ALWAYS_INLINE_EVEN_DEBUG)
# define MOZALLOC_INLINE MOZ_ALWAYS_INLINE_EVEN_DEBUG
#elif defined(HAVE_FORCEINLINE)
# define MOZALLOC_INLINE __forceinline
#else

View File

@ -32,13 +32,22 @@
* otherwise. This is only a (much) stronger version of the MOZ_INLINE hint:
* compilers are not guaranteed to respect it (although they're much more likely
* to do so).
*
* The MOZ_ALWAYS_INLINE_EVEN_DEBUG macro is yet stronger. It tells the
* compiler to inline even in DEBUG builds. It should be used very rarely.
*/
#if defined(_MSC_VER)
# define MOZ_ALWAYS_INLINE __forceinline
# define MOZ_ALWAYS_INLINE_EVEN_DEBUG __forceinline
#elif defined(__GNUC__)
# define MOZ_ALWAYS_INLINE __attribute__((always_inline)) MOZ_INLINE
# define MOZ_ALWAYS_INLINE_EVEN_DEBUG __attribute__((always_inline)) MOZ_INLINE
#else
# define MOZ_ALWAYS_INLINE_EVEN_DEBUG MOZ_INLINE
#endif
#if defined(DEBUG)
# define MOZ_ALWAYS_INLINE MOZ_INLINE
#else
# define MOZ_ALWAYS_INLINE MOZ_ALWAYS_INLINE_EVEN_DEBUG
#endif
/*