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

Unified Diff: base/compiler_specific.h

Issue 2518253002: Move Partition Allocator into Chromium base. (Closed)
Patch Set: Respond to more of Primiano's comments; move PartitionAllocator.* back to wtf; some build fixes Created 4 years 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: base/compiler_specific.h
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 0f4c058b3be43963d76c23b0b3b8ec89fc8b3767..278ef924f91ee36a70bf4042ecfd3aebd930ef72 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -230,4 +230,18 @@
#define HAS_FEATURE(FEATURE) 0
#endif
+#if defined(COMPILER_GCC)
gab 2016/12/05 18:51:48 The last comment below makes this not compiler spe
+#define PRETTY_FUNCTION __PRETTY_FUNCTION__
+#elif defined(COMPILER_MSVC)
+#define PRETTY_FUNCTION __FUNCSIG__
+#else
+#define PRETTY_FUNCTION __func__
+#endif
+
+// Returns a string that contains the type name of |T| as a substring.
+template <typename T>
+inline const char* GetStringWithTypeName() {
gab 2016/12/05 18:51:48 Given this is only used in base/allocator it shoul
palmer 2016/12/06 00:58:25 Turns out I can leave it in WTF (since I moved wtf
+ return PRETTY_FUNCTION;
gab 2016/12/05 18:51:48 I think typeid(T).name() would be cleaner here? h
palmer 2016/12/06 00:58:25 It would be, but the compiler says: "error: cannot
gab 2016/12/06 15:43:21 Interesting, I couldn't find where this flag is se
+}
+
#endif // BASE_COMPILER_SPECIFIC_H_

Powered by Google App Engine
This is Rietveld 408576698