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

Unified Diff: third_party/WebKit/Source/wtf/Allocator.h

Issue 1474213002: [PartitionAlloc] Annotate common Blink types for heap profiling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctti
Patch Set: Remove redundancy from macro Created 5 years, 1 month 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/WebKit/Source/wtf/Allocator.h
diff --git a/third_party/WebKit/Source/wtf/Allocator.h b/third_party/WebKit/Source/wtf/Allocator.h
index 5536245c201d8c6becfd1678e8ffc203dbfe6940..989ffb0afa08cc507bc5cf2b057a6dd5b5baba4d 100644
--- a/third_party/WebKit/Source/wtf/Allocator.h
+++ b/third_party/WebKit/Source/wtf/Allocator.h
@@ -94,14 +94,14 @@ namespace WTF {
// };
//
-#define USING_FAST_MALLOC(type) \
+#define USING_FAST_MALLOC_INTERNAL(type, typeName) \
public: \
void* operator new(size_t, void* p) { return p; } \
void* operator new[](size_t, void* p) { return p; } \
\
void* operator new(size_t size) \
{ \
- return ::WTF::Partitions::fastMalloc(size, WTF_HEAP_PROFILER_TYPE_NAME(type)); \
+ return ::WTF::Partitions::fastMalloc(size, typeName); \
} \
\
void operator delete(void* p) \
@@ -111,7 +111,7 @@ public: \
\
void* operator new[](size_t size) \
{ \
- return ::WTF::Partitions::fastMalloc(size, WTF_HEAP_PROFILER_TYPE_NAME(type)); \
+ return ::WTF::Partitions::fastMalloc(size, typeName); \
} \
\
void operator delete[](void* p) \
@@ -130,6 +130,9 @@ public: \
private: \
typedef int __thisIsHereToForceASemicolonAfterThisMacro
+#define USING_FAST_MALLOC(type) USING_FAST_MALLOC_INTERNAL(type, WTF_HEAP_PROFILER_TYPE_NAME(type))
+#define USING_FAST_MALLOC_WITH_TYPE_NAME(type) USING_FAST_MALLOC_INTERNAL(type, #type)
haraken 2015/11/27 15:36:10 Add a comment and explain the difference of these
Ruud van Asseldonk 2015/11/27 16:31:19 Done.
+
} // namespace WTF
#endif /* WTF_Allocator_h */
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Handle.h ('k') | third_party/WebKit/Source/wtf/PartitionAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698