]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-105927: Add _PyWeakref_IS_DEAD() function (#105992)
authorVictor Stinner <vstinner@python.org>
Thu, 22 Jun 2023 19:56:44 +0000 (21:56 +0200)
committerGitHub <noreply@github.com>
Thu, 22 Jun 2023 19:56:44 +0000 (21:56 +0200)
commitc38da1e3e19a7bf1053c6d52e730e970efeceff6
treef66d68229c8c1c4667a08b29793d8b66480ca774
parentd8f87cdf94a6533c5cf2d25e09e6fa3eb06720b9
gh-105927: Add _PyWeakref_IS_DEAD() function (#105992)

* Add _PyWeakref_IS_DEAD() internal function.
* Modify is_dead_weakref() of Modules/_weakref.c and
  _pysqlite_drop_unused_cursor_references() to replace
  PyWeakref_GET_OBJECT() with _PyWeakref_IS_DEAD().
* Replace "int i" with "Py_ssize_t i" to iterate on cursors
  in _pysqlite_drop_unused_cursor_references().
Include/internal/pycore_weakref.h
Modules/_sqlite/connection.c
Modules/_weakref.c