]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-105268: Add _Py_FROM_GC() function to pycore_gc.h (#105362)
authorVictor Stinner <vstinner@python.org>
Tue, 6 Jun 2023 12:44:48 +0000 (14:44 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Jun 2023 12:44:48 +0000 (14:44 +0200)
commitc7bf74bacd2b2db308e80e532153ffaf6dbca851
treebff6836b63b54d70a62d1810ecfe9bd0000fdc83
parent963099ebd9ada501d125fc5101ae42f55967a6e8
gh-105268: Add _Py_FROM_GC() function to pycore_gc.h (#105362)

* gcmodule.c reuses _Py_AS_GC(op) for AS_GC()
* Move gcmodule.c FROM_GC() implementation to a new _Py_FROM_GC()
  static inline function in pycore_gc.h.
* _PyObject_IS_GC(): only get the type once
* gc_is_finalized(à) and PyObject_GC_IsFinalized() use
  _PyGC_FINALIZED(), instead of _PyGCHead_FINALIZED().
* Remove _Py_CAST() in pycore_gc.h: this header file is not built
  with C++.
Include/internal/pycore_gc.h
Include/internal/pycore_object.h
Modules/gcmodule.c