Bug 715093 - Get rid of MOZALLOC_INLINE in favour of MOZ_ALWAYS_INLINE; r=glandium
authorMs2ger <ms2ger@gmail.com>
Wed, 11 Jan 2012 09:22:16 +0100
changeset 85381 d5f3e38021fd52a6c331d4d532e4b1875461b26e
parent 85380 545fc4728614f090b8630428d46d1476c040b3a8
child 85382 2f310f45610707e33b63f292d144b946d7b8bec1
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs715093
milestone12.0a1
Bug 715093 - Get rid of MOZALLOC_INLINE in favour of MOZ_ALWAYS_INLINE; r=glandium
memory/mozalloc/mozalloc.h
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -46,16 +46,17 @@
  */
 
 #include <stdlib.h>
 #include <string.h>
 #if defined(__cplusplus)
 #  include <new>
 #endif
 #include "xpcom-config.h"
+#include "mozilla/Attributes.h"
 
 #define MOZALLOC_HAVE_XMALLOC
 
 #if defined(MOZALLOC_EXPORT)
 /* do nothing: it's been defined to __declspec(dllexport) by
  * mozalloc*.cpp on platforms where that's required. */
 #elif defined(XP_WIN) || (defined(XP_OS2) && defined(__declspec))
 #  define MOZALLOC_EXPORT __declspec(dllimport)
@@ -63,24 +64,16 @@
 /* Make sure symbols are still exported even if we're wrapped in a
  * |visibility push(hidden)| blanket. */
 #  define MOZALLOC_EXPORT __attribute__ ((visibility ("default")))
 #else
 #  define MOZALLOC_EXPORT
 #endif
 
 
-#if defined(NS_ALWAYS_INLINE)
-#  define MOZALLOC_INLINE NS_ALWAYS_INLINE inline
-#elif defined(HAVE_FORCEINLINE)
-#  define MOZALLOC_INLINE __forceinline
-#else
-#  define MOZALLOC_INLINE inline
-#endif
-
 /* Workaround build problem with Sun Studio 12 */
 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
 #  undef NS_WARN_UNUSED_RESULT
 #  define NS_WARN_UNUSED_RESULT
 #  undef NS_ATTR_MALLOC
 #  define NS_ATTR_MALLOC
 #endif
 
@@ -218,59 +211,59 @@ MOZALLOC_EXPORT void* moz_valloc(size_t 
 #define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
 #else
 #define MOZALLOC_THROW_IF_HAS_EXCEPTIONS throw()
 #define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS throw(std::bad_alloc)
 #endif
 
 #define MOZALLOC_THROW_BAD_ALLOC MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW MOZ_ALWAYS_INLINE
 void* operator new(size_t size) MOZALLOC_THROW_BAD_ALLOC
 {
     return moz_xmalloc(size);
 }
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW MOZ_ALWAYS_INLINE
 void* operator new(size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     return moz_malloc(size);
 }
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW MOZ_ALWAYS_INLINE
 void* operator new[](size_t size) MOZALLOC_THROW_BAD_ALLOC
 {
     return moz_xmalloc(size);
 }
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW MOZ_ALWAYS_INLINE
 void* operator new[](size_t size, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     return moz_malloc(size);
 }
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW MOZ_ALWAYS_INLINE
 void operator delete(void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     return moz_free(ptr);
 }
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW MOZ_ALWAYS_INLINE
 void operator delete(void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     return moz_free(ptr);
 }
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW MOZ_ALWAYS_INLINE
 void operator delete[](void* ptr) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     return moz_free(ptr);
 }
 
-MOZALLOC_EXPORT_NEW MOZALLOC_INLINE
+MOZALLOC_EXPORT_NEW MOZ_ALWAYS_INLINE
 void operator delete[](void* ptr, const std::nothrow_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     return moz_free(ptr);
 }
 
 
 /*
  * We also add a new allocator variant: "fallible operator new."
@@ -292,35 +285,35 @@ void operator delete[](void* ptr, const 
  */
 
 namespace mozilla {
 
 struct MOZALLOC_EXPORT fallible_t { };
 
 } /* namespace mozilla */
 
-MOZALLOC_INLINE
+MOZ_ALWAYS_INLINE
 void* operator new(size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     return moz_malloc(size);
 }
 
-MOZALLOC_INLINE
+MOZ_ALWAYS_INLINE
 void* operator new[](size_t size, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     return moz_malloc(size);
 }
 
-MOZALLOC_INLINE
+MOZ_ALWAYS_INLINE
 void operator delete(void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     moz_free(ptr);
 }
 
-MOZALLOC_INLINE
+MOZ_ALWAYS_INLINE
 void operator delete[](void* ptr, const mozilla::fallible_t&) MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 {
     moz_free(ptr);
 }
 
 #endif  /* ifdef __cplusplus */