File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -284,8 +284,14 @@ extern PyGC_Head *_PyGC_generation0;
284
284
#define _PyGC_FINALIZED (o ) _PyGCHead_FINALIZED(_Py_AS_GC(o))
285
285
#define _PyGC_SET_FINALIZED (o ) _PyGCHead_SET_FINALIZED(_Py_AS_GC(o))
286
286
287
- /* Tell the GC to track this object. NB: While the object is tracked the
288
- * collector it must be safe to call the ob_traverse method. */
287
+ /* Tell the GC to track this object.
288
+ *
289
+ * NB: While the object is tracked the collector it must be safe to call the
290
+ * ob_traverse method.
291
+ *
292
+ * Internal note: _PyGC_generation0->gc.gc_prev doesn't have any bit flags
293
+ * because it's not object header. Wo we skip using _PyGCHead_SET_PREV() here.
294
+ */
289
295
#define _PyObject_GC_TRACK (o ) do { \
290
296
PyGC_Head *g = _Py_AS_GC(o); \
291
297
if (g->gc.gc_next != NULL) \
@@ -298,8 +304,9 @@ extern PyGC_Head *_PyGC_generation0;
298
304
} while (0);
299
305
300
306
/* Tell the GC to stop tracking this object.
301
- * NOTE: This may be called while GC. So _PyGC_PREV_MASK_INTERNAL must be
302
- * cleared.
307
+ *
308
+ * Internal note: This may be called while GC. So _PyGC_PREV_MASK_INTERNAL must
309
+ * be cleared. Only _PyGC_PREV_MASK_FINALIZED bit is kept.
303
310
*/
304
311
#define _PyObject_GC_UNTRACK (o ) do { \
305
312
PyGC_Head *g = _Py_AS_GC(o); \
Original file line number Diff line number Diff line change 34
34
#define GC_DEBUG (0) /* More asserts */
35
35
36
36
// Bit 0 of gc_prev is used for _PyGC_PREV_MASK_FINALIZED in objimpl.h
37
+ // These two mask bits are used only between GC.
37
38
#define MASK_COLLECTING (1 << 1)
38
39
#define MASK_TENTATIVELY_UNREACHABLE (1 << 2)
39
40
You can’t perform that action at this time.
0 commit comments