Chromium Code Reviews| Index: Source/platform/heap/ThreadState.h |
| diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h |
| index 481455f76ba068a19a56142693ff03493579dffc..f44c4b90dd8a0695faa79a854fbc799643989c3e 100644 |
| --- a/Source/platform/heap/ThreadState.h |
| +++ b/Source/platform/heap/ThreadState.h |
| @@ -72,11 +72,13 @@ using TraceCallback = VisitorCallback; |
| using WeakCallback = VisitorCallback; |
| using EphemeronCallback = VisitorCallback; |
| -// Declare that a class has a pre-finalizer function. The function is called in |
| -// the object's owner thread, and can access Member<>s to other |
| -// garbage-collected objects allocated in the thread. However we must not |
| -// allocate new garbage-collected objects, nor update Member<> and Persistent<> |
| -// pointers. |
| +// Declare that a class has a pre-finalizer function. The function is called in |
|
sof
2015/06/18 18:14:03
Thanks; it doesn't have to be 100% complete, but e
haraken
2015/06/18 18:54:38
Updated the comment.
|
| +// the object's owner thread. The pre-finalizer is called before any object gets |
| +// swept, so it is allowed to touch on-heap objects that may be collected in the |
| +// GC cycle. If you cannot avoid touching on-heap objects in a destructor (which |
| +// is not allowed), you can consider using the pre-finalizer for doing that |
| +// work. The only restriction is that the pre-finalizer must not resurrect |
| +// dead objects (e.g., store unmarked objects into Members etc). |
| // |
| // This feature is similar to the HeapHashMap<WeakMember<Foo>, OwnPtr<Disposer>> |
| // idiom. The difference between this and the idiom is that pre-finalizer |
| @@ -529,6 +531,7 @@ public: |
| void pushThreadLocalWeakCallback(void*, WeakCallback); |
| bool popAndInvokeThreadLocalWeakCallback(Visitor*); |
| + void threadLocalWeakProcessing(); |
| size_t objectPayloadSizeForTesting(); |
| void prepareHeapForTermination(); |