Skip to content

bpo-40241: Add pycore_gc.h header file#19494

Merged
vstinner merged 1 commit intopython:masterfrom
vstinner:pycore_gc
Apr 13, 2020
Merged

bpo-40241: Add pycore_gc.h header file#19494
vstinner merged 1 commit intopython:masterfrom
vstinner:pycore_gc

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Apr 13, 2020

Move the PyGC_Head structure and the following private macros to the
internal C API:

  • _PyGCHead_FINALIZED()
  • _PyGCHead_NEXT()
  • _PyGCHead_PREV()
  • _PyGCHead_SET_FINALIZED()
  • _PyGCHead_SET_NEXT()
  • _PyGCHead_SET_PREV()
  • _PyGC_FINALIZED()
  • _PyGC_PREV_MASK
  • _PyGC_PREV_MASK_COLLECTING
  • _PyGC_PREV_MASK_FINALIZED
  • _PyGC_PREV_SHIFT
  • _PyGC_SET_FINALIZED()
  • _PyObject_GC_IS_TRACKED()
  • _PyObject_GC_MAY_BE_TRACKED()
  • _Py_AS_GC(o)

Keep the private _PyGC_FINALIZED() macro in the public C API for
backward compatibility with Python 3.8: make it an alias to the new
PyObject_GC_IsFinalized() function.

Move the SIZEOF_PYGC_HEAD constant from _testcapi module to
_testinternalcapi module.

https://bugs.python.org/issue40241

Move the PyGC_Head structure and the following private macros to the
internal C API:

* _PyGCHead_FINALIZED()
* _PyGCHead_NEXT()
* _PyGCHead_PREV()
* _PyGCHead_SET_FINALIZED()
* _PyGCHead_SET_NEXT()
* _PyGCHead_SET_PREV()
* _PyGC_FINALIZED()
* _PyGC_PREV_MASK
* _PyGC_PREV_MASK_COLLECTING
* _PyGC_PREV_MASK_FINALIZED
* _PyGC_PREV_SHIFT
* _PyGC_SET_FINALIZED()
* _PyObject_GC_IS_TRACKED()
* _PyObject_GC_MAY_BE_TRACKED()
* _Py_AS_GC(o)

Keep the private _PyGC_FINALIZED() macro in the public C API for
backward compatibility with Python 3.8: make it an alias to the new
PyObject_GC_IsFinalized() function.

Move the SIZEOF_PYGC_HEAD constant from _testcapi module to
_testinternalcapi module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants