Bug 1423461 - Use noexcept in mozalloc.h on android. r?njn draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 06 Dec 2017 11:38:59 +0900
changeset 708087 b9f84a0f2b7556b6d70bee52cddcf17b2ed9fb37
parent 708086 95c174e000deeaa6dbd5906ca57117122e6b4552
child 708093 c947d34a1c13cf908ba43efaa17fd8985d62dbdb
child 708195 653db78c48078f009526866c2fecb4eb9e7be084
push id92277
push userbmo:mh+mozilla@glandium.org
push dateWed, 06 Dec 2017 06:26:57 +0000
reviewersnjn
bugs1423461, 1163171
milestone59.0a1
Bug 1423461 - Use noexcept in mozalloc.h on android. r?njn Bug 1163171 removed support for building for android with GCC, and we don't need to use throw() anymore. We can use the same code as for other non-Windows platforms.
memory/mozalloc/mozalloc.h
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -120,26 +120,17 @@ MOZ_END_EXTERN_C
  * visibility on OS X/gcc. These symbols are force-inline and not
  * exported. */
 #if defined(XP_MACOSX)
 #  define MOZALLOC_EXPORT_NEW MFBT_API
 #else
 #  define MOZALLOC_EXPORT_NEW
 #endif
 
-#if defined(ANDROID)
-/*
- * It's important to always specify 'throw()' in GCC because it's used to tell
- * GCC that 'new' may return null. That makes GCC null-check the result before
- * potentially initializing the memory to zero.
- * Also, the Android minimalistic headers don't include std::bad_alloc.
- */
-#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS throw()
-#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
-#elif defined(_MSC_VER)
+#if defined(_MSC_VER)
 /*
  * Suppress build warning spam (bug 578546).
  */
 #define MOZALLOC_THROW_IF_HAS_EXCEPTIONS
 #define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
 #elif __cplusplus >= 201103
 /*
  * C++11 has deprecated exception-specifications in favour of |noexcept|.