Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: third_party/tcmalloc/chromium/src/libc_override_gcc_and_weak.h

Issue 14321006: Adds TCMalloc support for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4d794e90a2ab08b70f433d95fb539b5763141292 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_BACK_ALLOC
Peter Beverloo 2013/05/08 16:17:13 Should this read STD_BAD_ALLOC?
bulach 2013/05/08 18:22:49 duh :) done.
+#else
+#define STD_BACK_ALLOC std::bad_alloc
+#endif
+
+void* operator new(size_t size) throw (STD_BACK_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_BACK_ALLOC)
ALIAS(tc_newarray);
void operator delete[](void* p) __THROW
ALIAS(tc_deletearray);

Powered by Google App Engine
This is Rietveld 408576698