| 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 a6ddd0b916d5d3dcd12cc59cbf4ab1516c74db6f..599f91b941cedd4424b6e72804ffaa9452122a77 100644
|
| --- a/third_party/WebKit/Source/wtf/Allocator.h
|
| +++ b/third_party/WebKit/Source/wtf/Allocator.h
|
| @@ -33,45 +33,50 @@ 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,42 +99,37 @@ namespace WTF {
|
| // };
|
| //
|
|
|
| -#define USING_FAST_MALLOC(type) \
|
| -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); \
|
| - } \
|
| - \
|
| - void operator delete(void* p) \
|
| - { \
|
| - ::WTF::Partitions::fastFree(p); \
|
| - } \
|
| - \
|
| - void* operator new[](size_t size) \
|
| - { \
|
| - return ::WTF::Partitions::fastMalloc(size); \
|
| - } \
|
| - \
|
| - 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(type) \
|
| + 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); \
|
| + } \
|
| + \
|
| + void operator delete(void* p) { \
|
| + ::WTF::Partitions::fastFree(p); \
|
| + } \
|
| + \
|
| + void* operator new[](size_t size) { \
|
| + return ::WTF::Partitions::fastMalloc(size); \
|
| + } \
|
| + \
|
| + 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
|
|
|
| -} // namespace WTF
|
| +} // namespace WTF
|
|
|
| #endif /* WTF_Allocator_h */
|
|
|