| 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 93e19fce0a57fa9bb2d92feb948eea906cbf5bb4..b5eeda470ccfae30a314bd0e44c9756590994666 100644
|
| --- a/third_party/WebKit/Source/wtf/Allocator.h
|
| +++ b/third_party/WebKit/Source/wtf/Allocator.h
|
| @@ -33,45 +33,51 @@ namespace WTF {
|
| // method. That trace method will be called automatically by the on-heap
|
| // collections.
|
| //
|
| -#define DISALLOW_NEW() \
|
| - private: \
|
| - void* operator new(size_t) = delete; \
|
| - void* operator new(size_t, NotNullTag, void*) = delete; \
|
| - void* operator new(size_t, void*) = delete; \
|
| - public:
|
| +#define DISALLOW_NEW() \
|
| + private: \
|
| + void* operator new(size_t) = delete; \
|
| + void* operator new(size_t, NotNullTag, void*) = delete; \
|
| + void* operator new(size_t, void*) = delete; \
|
| + \
|
| + public:
|
|
|
| -#define DISALLOW_NEW_EXCEPT_PLACEMENT_NEW() \
|
| - public: \
|
| - using IsAllowOnlyPlacementNew = int; \
|
| - void* operator new(size_t, NotNullTag, void* location) { return location; } \
|
| - void* operator new(size_t, void* location) { return location; } \
|
| - private: \
|
| - void* operator new(size_t) = delete; \
|
| - public:
|
| +#define DISALLOW_NEW_EXCEPT_PLACEMENT_NEW() \
|
| + public: \
|
| + using IsAllowOnlyPlacementNew = int; \
|
| + void* operator new(size_t, NotNullTag, void* location) { return location; } \
|
| + void* operator new(size_t, void* location) { return location; } \
|
| + \
|
| + private: \
|
| + void* operator new(size_t) = delete; \
|
| + \
|
| + public:
|
|
|
| -#define STATIC_ONLY(Type) \
|
| - private: \
|
| - Type() = delete; \
|
| - Type(const Type&) = delete; \
|
| - Type& operator=(const Type&) = delete; \
|
| - void* operator new(size_t) = delete; \
|
| - void* operator new(size_t, NotNullTag, void*) = delete; \
|
| - void* operator new(size_t, void*) = delete; \
|
| - public:
|
| +#define STATIC_ONLY(Type) \
|
| + private: \
|
| + Type() = delete; \
|
| + Type(const Type&) = delete; \
|
| + Type& operator=(const Type&) = delete; \
|
| + void* operator new(size_t) = delete; \
|
| + void* operator new(size_t, NotNullTag, void*) = delete; \
|
| + void* operator new(size_t, void*) = delete; \
|
| + \
|
| + public:
|
|
|
| -#define IS_GARBAGE_COLLECTED_TYPE() \
|
| - public: \
|
| - using IsGarbageCollectedTypeMarker = int; \
|
| - private:
|
| +#define IS_GARBAGE_COLLECTED_TYPE() \
|
| + public: \
|
| + using IsGarbageCollectedTypeMarker = int; \
|
| + \
|
| + private:
|
|
|
| #if COMPILER(CLANG)
|
| -#define STACK_ALLOCATED() \
|
| - private: \
|
| - __attribute__((annotate("blink_stack_allocated"))) \
|
| - void* operator new(size_t) = delete; \
|
| - void* operator new(size_t, NotNullTag, void*) = delete; \
|
| - void* operator new(size_t, void*) = delete; \
|
| - public:
|
| +#define STACK_ALLOCATED() \
|
| + private: \
|
| + __attribute__((annotate("blink_stack_allocated"))) void* operator new( \
|
| + size_t) = delete; \
|
| + void* operator new(size_t, NotNullTag, void*) = delete; \
|
| + void* operator new(size_t, void*) = delete; \
|
| + \
|
| + public:
|
| #else
|
| #define STACK_ALLOCATED() DISALLOW_NEW()
|
| #endif
|
| @@ -94,41 +100,30 @@ namespace WTF {
|
| // };
|
| //
|
|
|
| -#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, typeName); \
|
| - } \
|
| - \
|
| - void operator delete(void* p) \
|
| - { \
|
| - ::WTF::Partitions::fastFree(p); \
|
| - } \
|
| - \
|
| - void* operator new[](size_t size) \
|
| - { \
|
| - return ::WTF::Partitions::fastMalloc(size, typeName); \
|
| - } \
|
| - \
|
| - void operator delete[](void* p) \
|
| - { \
|
| - ::WTF::Partitions::fastFree(p); \
|
| - } \
|
| - void* operator new(size_t, NotNullTag, void* location) \
|
| - { \
|
| - ASSERT(location); \
|
| - return location; \
|
| - } \
|
| - static const char* classNameForAllocator() \
|
| - { \
|
| - return #type; \
|
| - } \
|
| -private: \
|
| -typedef int __thisIsHereToForceASemicolonAfterThisMacro
|
| +#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, typeName); \
|
| + } \
|
| + \
|
| + void operator delete(void* p) { ::WTF::Partitions::fastFree(p); } \
|
| + \
|
| + void* operator new[](size_t size) { \
|
| + return ::WTF::Partitions::fastMalloc(size, typeName); \
|
| + } \
|
| + \
|
| + void operator delete[](void* p) { ::WTF::Partitions::fastFree(p); } \
|
| + void* operator new(size_t, NotNullTag, void* location) { \
|
| + ASSERT(location); \
|
| + return location; \
|
| + } \
|
| + static const char* classNameForAllocator() { return #type; } \
|
| + \
|
| + private: \
|
| + typedef int __thisIsHereToForceASemicolonAfterThisMacro
|
|
|
| // Both of these macros enable fast malloc and provide type info to the heap
|
| // profiler. The regular macro does not provide type info in official builds,
|
| @@ -136,9 +131,11 @@ typedef int __thisIsHereToForceASemicolonAfterThisMacro
|
| // variant provides type info unconditionally, so it should be used sparingly.
|
| // Furthermore, the |WITH_TYPE_NAME| variant does not work if |type| is a
|
| // template argument; |USING_FAST_MALLOC| does.
|
| -#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)
|
| +#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)
|
|
|
| -} // namespace WTF
|
| +} // namespace WTF
|
|
|
| #endif /* WTF_Allocator_h */
|
|
|