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

Side by Side Diff: third_party/WebKit/Source/wtf/Allocator.h

Issue 1433983002: Rename IsAllowOnlyInlineAllocation<T> to AllowsOnlyPlacementNew<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/Deque.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WTF_Allocator_h 5 #ifndef WTF_Allocator_h
6 #define WTF_Allocator_h 6 #define WTF_Allocator_h
7 7
8 #include "wtf/Assertions.h" 8 #include "wtf/Assertions.h"
9 #include "wtf/Partitions.h" 9 #include "wtf/Partitions.h"
10 #include "wtf/StdLibExtras.h" 10 #include "wtf/StdLibExtras.h"
(...skipping 15 matching lines...) Expand all
26 // DISALLOW_NEW(): Cannot be allocated with new operators but can be a 26 // DISALLOW_NEW(): Cannot be allocated with new operators but can be a
27 // part of object. If it has Members you need a trace method and the containing 27 // part of object. If it has Members you need a trace method and the containing
28 // object needs to call that trace method. 28 // object needs to call that trace method.
29 // 29 //
30 // DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(): Allows only placement new operator. Thi s 30 // DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(): Allows only placement new operator. Thi s
31 // disallows general allocation of this object but allows to put the object as a 31 // disallows general allocation of this object but allows to put the object as a
32 // value object in collections. If these have Members you need to have a trace 32 // value object in collections. If these have Members you need to have a trace
33 // method. That trace method will be called automatically by the on-heap 33 // method. That trace method will be called automatically by the on-heap
34 // collections. 34 // collections.
35 // 35 //
36 #define DISALLOW_NEW() \ 36 #define DISALLOW_NEW() \
37 private: \ 37 private: \
38 void* operator new(size_t) = delete; \ 38 void* operator new(size_t) = delete; \
39 void* operator new(size_t, NotNullTag, void*) = delete; \ 39 void* operator new(size_t, NotNullTag, void*) = delete; \
40 void* operator new(size_t, void*) = delete; \ 40 void* operator new(size_t, void*) = delete; \
41 public: 41 public:
42 42
43 #define DISALLOW_NEW_EXCEPT_PLACEMENT_NEW() \ 43 #define DISALLOW_NEW_EXCEPT_PLACEMENT_NEW() \
44 public: \ 44 public: \
45 using IsAllowOnlyInlineAllocation = int; \ 45 using IsAllowOnlyPlacementNew = int; \
46 void* operator new(size_t, NotNullTag, void* location) { return location ; } \ 46 void* operator new(size_t, NotNullTag, void* location) { return location ; } \
47 void* operator new(size_t, void* location) { return location; } \ 47 void* operator new(size_t, void* location) { return location; } \
48 private: \ 48 private: \
49 void* operator new(size_t) = delete; \ 49 void* operator new(size_t) = delete; \
50 public: 50 public:
51 51
52 #define STATIC_ONLY(Type) \ 52 #define STATIC_ONLY(Type) \
53 private: \ 53 private: \
54 Type() = delete; \ 54 Type() = delete; \
55 Type(const Type&) = delete; \ 55 Type(const Type&) = delete; \
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 static const char* classNameForAllocator() \ 126 static const char* classNameForAllocator() \
127 { \ 127 { \
128 return #type; \ 128 return #type; \
129 } \ 129 } \
130 private: \ 130 private: \
131 typedef int __thisIsHereToForceASemicolonAfterThisMacro 131 typedef int __thisIsHereToForceASemicolonAfterThisMacro
132 132
133 } // namespace WTF 133 } // namespace WTF
134 134
135 #endif /* WTF_Allocator_h */ 135 #endif /* WTF_Allocator_h */
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/Deque.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698