Index: third_party/tcmalloc/chromium/src/libc_override_gcc_and_weak.h |
diff --git a/third_party/tcmalloc/chromium/src/libc_override_gcc_and_weak.h b/third_party/tcmalloc/chromium/src/libc_override_gcc_and_weak.h |
index 070ebf72aac92304c195dc08b4c563f42589190e..3b858caa444261e5d36e6586fb3f39eb46c29907 100644 |
--- a/third_party/tcmalloc/chromium/src/libc_override_gcc_and_weak.h |
+++ b/third_party/tcmalloc/chromium/src/libc_override_gcc_and_weak.h |
@@ -53,11 +53,18 @@ |
#define ALIAS(tc_fn) __attribute__ ((alias (#tc_fn))) |
-void* operator new(size_t size) throw (std::bad_alloc) |
+#if defined(__ANDROID__) |
+// Android's bionic doesn't have std::bad_alloc. |
+#define STD_BAD_ALLOC |
+#else |
+#define STD_BAD_ALLOC std::bad_alloc |
+#endif |
+ |
+void* operator new(size_t size) throw (STD_BAD_ALLOC) |
ALIAS(tc_new); |
void operator delete(void* p) __THROW |
ALIAS(tc_delete); |
-void* operator new[](size_t size) throw (std::bad_alloc) |
+void* operator new[](size_t size) throw (STD_BAD_ALLOC) |
ALIAS(tc_newarray); |
void operator delete[](void* p) __THROW |
ALIAS(tc_deletearray); |