diff options
author | Sam Gross <colesbury@gmail.com> | 2024-07-15 21:50:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 21:50:10 (GMT) |
commit | d23be3947ced081914f4458c84f729c9c37f0219 (patch) | |
tree | 6e4866f6c0bb0161a918566642fe37a0520da968 /Lib/_pyrepl | |
parent | 82a4dac9f6131954c32dac9d0277283fc5b499a9 (diff) | |
download | cpython-d23be3947ced081914f4458c84f729c9c37f0219.zip cpython-d23be3947ced081914f4458c84f729c9c37f0219.tar.gz cpython-d23be3947ced081914f4458c84f729c9c37f0219.tar.bz2 |
gh-121794: Don't set `ob_tid` to zero in fast-path dealloc (#121799)
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.
Diffstat (limited to 'Lib/_pyrepl')
0 files changed, 0 insertions, 0 deletions