mirror of
https://github.com/python/cpython.git
synced 2026-01-29 06:06:01 +00:00
We should maintain the invariant that a zero `ob_tid` implies the refcount fields are merged. * Move the assignment in `_Py_MergeZeroLocalRefcount` to immediately before the refcount merge. * Update `_PyTrash_thread_destroy_chain` to set `ob_ref_shared` to `_Py_REF_MERGED` when setting `ob_tid` to zero. Also check this invariant with assertions in the GC in debug builds. That uncovered a bug when running out of memory during GC. (cherry picked from commit d23be3947ced081914f4458c84f729c9c37f0219) Co-authored-by: Sam Gross <colesbury@gmail.com>
Miscellaneous source files for the main Python shared library