diff --git a/memory/mozalloc/mozalloc.h b/memory/mozalloc/mozalloc.h index 3d1e12a74c8..7d0f073165b 100644 --- a/memory/mozalloc/mozalloc.h +++ b/memory/mozalloc/mozalloc.h @@ -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 diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index edbc8b23f01..89f3641fc9f 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -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 /*