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

Unified Diff: Source/heap/Heap.h

Issue 199733009: Oilpan: tighten DISALLOW_ALLOCATION so it does not allow inline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comment Created 6 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/heap/Heap.h
diff --git a/Source/heap/Heap.h b/Source/heap/Heap.h
index 75821fbe7c821025369c566ada3d1a3db206efe8..c84a0ce76f81da717d30a1754e83a1ff535940fd 100644
--- a/Source/heap/Heap.h
+++ b/Source/heap/Heap.h
@@ -1025,20 +1025,36 @@ T* adoptRefCountedGarbageCollected(T* ptr)
}
#if COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS)
-#define DISALLOW_ALLOCATION() \
- private: \
+#define DISALLOW_ALLOCATION() \
+ private: \
+ void* operator new(size_t) = delete; \
+ void* operator new(size_t, NotNullTag, void*) = delete; \
+ void* operator new(size_t, void*) = delete;
+
+#define ALLOW_ONLY_INLINE_ALLOCATION() \
+ public: \
+ 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;
+
#else
-#define DISALLOW_ALLOCATION() \
- private: \
- void* operator new(size_t);
-#endif
+
+#define DISALLOW_ALLOCATION() \
+ private: \
+ void* operator new(size_t); \
+ void* operator new(size_t, NotNullTag, void*); \
+ void* operator new(size_t, void*)
#define ALLOW_ONLY_INLINE_ALLOCATION() \
public: \
void* operator new(size_t, NotNullTag, void* location) { return location; } \
void* operator new(size_t, void* location) { return location; } \
- DISALLOW_ALLOCATION()
+ private: \
+ void* operator new(size_t);
+
+#endif
+
// These macros insert annotations that the Blink GC plugin for clang uses for
// verification. STACK_ALLOCATED is used to declare that objects of this type
@@ -1047,10 +1063,13 @@ T* adoptRefCountedGarbageCollected(T* ptr)
// GC_PLUGIN_IGNORE a bug-number should be provided as an argument where the
// bug describes what needs to happen to remove the GC_PLUGIN_IGNORE again.
#if COMPILER(CLANG) && !defined(ADDRESS_SANITIZER)
-#define STACK_ALLOCATED() \
- private: \
- __attribute__((annotate("blink_stack_allocated"))) \
- void* operator new(size_t) = delete;
+#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;
+
#define GC_PLUGIN_IGNORE(bug) \
__attribute__((annotate("blink_gc_plugin_ignore")))
#else
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698