Index: Source/platform/heap/Heap.h |
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h |
index 175a982576bbbebe1328c16074263cfea5a76014..c310e5fde489e9fce68da8b9f31a22ac3a4b9621 100644 |
--- a/Source/platform/heap/Heap.h |
+++ b/Source/platform/heap/Heap.h |
@@ -1024,6 +1024,27 @@ T* adoptRefCountedGarbageCollected(T* ptr) |
return ptr; |
} |
+// Classes that contain heap references but aren't themselves heap |
+// allocated, have some extra macros available which allows their use |
+// to be restricted to cases where the garbage collector is able |
+// to discover their heap references. |
+// |
+// STACK_ALLOCATED(): Use if the object is only stack allocated. Heap objects |
+// should be in Members but you do not need the trace method as they are on |
+// the stack. (Down the line these might turn in to raw pointers, but for |
+// now Members indicates that we have thought about them and explicitly |
+// taken care of them.) |
+// |
+// DISALLOW_ALLOCATION(): Cannot be allocated with new operators but can |
+// be a part object. If it has Members you need a trace method and the |
+// containing object needs to call that trace method. |
+// |
+// ALLOW_ONLY_INLINE_ALLOCATION(): Allows only placement new operator. |
+// This disallows general allocation of this object but allows to put |
+// the object as a value object in collections. If these have Members you |
+// need to have a trace method. That trace method will be called |
+// automatically by the Heap collections. |
+// |
#if COMPILER_SUPPORTS(CXX_DELETED_FUNCTIONS) |
#define DISALLOW_ALLOCATION() \ |
private: \ |