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

Unified Diff: Source/wtf/Allocator.h

Issue 1278983003: Adding allocator annotations to blink classes and structs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed patch conflict Created 5 years, 4 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
« no previous file with comments | « Source/web/SharedWorkerRepositoryClientImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Allocator.h
diff --git a/Source/wtf/Allocator.h b/Source/wtf/Allocator.h
index 29adf01267e863cbee05e0b6c84552998bdba987..5b39698e5abc1a71762f0fffc422df4cacf945b6 100644
--- a/Source/wtf/Allocator.h
+++ b/Source/wtf/Allocator.h
@@ -5,6 +5,8 @@
#ifndef WTF_Allocator_h
#define WTF_Allocator_h
+#include "wtf/StdLibExtras.h"
+
namespace WTF {
// Classes that contain references to garbage-collected objects but aren't
@@ -33,7 +35,8 @@ namespace WTF {
private: \
void* operator new(size_t) = delete; \
void* operator new(size_t, NotNullTag, void*) = delete; \
- void* operator new(size_t, void*) = delete;
+ void* operator new(size_t, void*) = delete; \
+ public:
#define ALLOW_ONLY_INLINE_ALLOCATION() \
public: \
@@ -41,11 +44,18 @@ namespace WTF {
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;
+ void* operator new(size_t) = delete; \
+ public:
#define STATIC_ONLY(Type) \
private: \
- Type() = delete;
+ 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:
#if COMPILER(CLANG)
#define STACK_ALLOCATED() \
@@ -53,7 +63,8 @@ namespace WTF {
__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;
+ void* operator new(size_t, void*) = delete; \
+ public:
#else
#define STACK_ALLOCATED() DISALLOW_ALLOCATION()
#endif
« no previous file with comments | « Source/web/SharedWorkerRepositoryClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698