@@ -7,14 +7,14 @@ They carry metadata to track ownership and support optimizations such as tagged
77
88- A ` _PyStackRef ` is a tagged pointer-sized value (see ` Include/internal/pycore_stackref.h ` ).
99- Tag bits distinguish three cases:
10- - ` Py_TAG_REFCNT ` clear - reference count lives on the pointed-to object.
10+ - ` Py_TAG_REFCNT ` unset - reference count lives on the pointed-to object.
1111 - ` Py_TAG_REFCNT ` set - ownership is "borrowed" (no refcount to drop on close) or the object is immortal.
12- - ` Py_INT_TAG ` - tagged small integer stored directly in the stackref (no heap allocation).
12+ - ` Py_INT_TAG ` set - tagged small integer stored directly in the stackref (no heap allocation).
1313- Special constants: ` PyStackRef_NULL ` , ` PyStackRef_ERROR ` , and embedded ` None ` /` True ` /` False ` .
1414
1515In GIL builds, most objects carry their refcount; tagged borrowed refs skip decref on close. In free
1616threading builds, the tag is also used to mark deferred refcounted objects so the GC can see them and
17- to avoid refcount contention for short-lived stack values .
17+ to avoid refcount contention on commonly shared objects .
1818
1919## Converting to and from PyObject*
2020
@@ -67,7 +67,7 @@ With `Py_GIL_DISABLED`, `Py_TAG_DEFERRED` is an alias for `Py_TAG_REFCNT`.
6767Objects that support deferred reference counting can be pushed to the evaluation
6868stack and stored in local variables without directly incrementing the reference
6969count because they are only freed during cyclic garbage collection. This avoids
70- reference count contention on short-lived values such as methods and types. The GC
70+ reference count contention on commonly shared objects such as methods and types. The GC
7171scans each thread's locals and evaluation stack to keep objects that use
7272deferred reference counting alive.
7373
0 commit comments