File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -286,11 +286,12 @@ extern PyGC_Head *_PyGC_generation0;
286
286
287
287
/* Tell the GC to track this object.
288
288
*
289
- * NB: While the object is tracked the collector it must be safe to call the
289
+ * NB: While the object is tracked by the collector, it must be safe to call the
290
290
* ob_traverse method.
291
291
*
292
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.
293
+ * because it's not object header. That's why we don't use _PyGCHead_SET_PREV()
294
+ * for it.
294
295
*/
295
296
#define _PyObject_GC_TRACK (o ) do { \
296
297
PyGC_Head *g = _Py_AS_GC(o); \
Original file line number Diff line number Diff line change 38
38
#define MASK_COLLECTING (1 << 1)
39
39
#define MASK_TENTATIVELY_UNREACHABLE (1 << 2)
40
40
41
- #define IS_TRACKED (o ) (_Py_AS_GC(o)->gc.gc_next != NULL)
42
41
#define IS_TENTATIVELY_UNREACHABLE (o ) ( \
43
42
(_Py_AS_GC(o)->gc.gc_prev & MASK_TENTATIVELY_UNREACHABLE) != 0)
44
43
@@ -294,8 +293,8 @@ validate_list(PyGC_Head *head, uintptr_t expected_mask)
294
293
/*** end of list stuff ***/
295
294
296
295
297
- /* Set all gc_refs = ob_refcnt. After this, gc_refs is > 0 for all objects
298
- * in containers.
296
+ /* Set all gc_refs = ob_refcnt. After this, gc_refs is > 0 and
297
+ * MASK_COLLECTING bit is set for all objects in containers.
299
298
*/
300
299
static void
301
300
update_refs (PyGC_Head * containers )
@@ -1496,7 +1495,7 @@ gc_is_tracked(PyObject *module, PyObject *obj)
1496
1495
{
1497
1496
PyObject * result ;
1498
1497
1499
- if (PyObject_IS_GC (obj ) && IS_TRACKED (obj ))
1498
+ if (PyObject_IS_GC (obj ) && _PyObject_GC_IS_TRACKED (obj ))
1500
1499
result = Py_True ;
1501
1500
else
1502
1501
result = Py_False ;
You can’t perform that action at this time.
0 commit comments