mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
GH-94851: check refcnt of immortal objects after finalization (GH-95001)
This commit is contained in:
parent
ac6a94c669
commit
73ee5a6b86
4 changed files with 4430 additions and 1 deletions
|
@ -14,9 +14,14 @@ extern "C" {
|
|||
#include "pycore_pystate.h" // _PyInterpreterState_GET()
|
||||
#include "pycore_runtime.h" // _PyRuntime
|
||||
|
||||
/* This value provides *effective* immortality, meaning the object should never
|
||||
be deallocated (until runtime finalization). See PEP 683 for more details about
|
||||
immortality, as well as a proposed mechanism for proper immortality. */
|
||||
#define _PyObject_IMMORTAL_REFCNT 999999999
|
||||
|
||||
#define _PyObject_IMMORTAL_INIT(type) \
|
||||
{ \
|
||||
.ob_refcnt = 999999999, \
|
||||
.ob_refcnt = _PyObject_IMMORTAL_REFCNT, \
|
||||
.ob_type = (type), \
|
||||
}
|
||||
#define _PyVarObject_IMMORTAL_INIT(type, size) \
|
||||
|
|
4402
Include/internal/pycore_runtime_init_generated.h
generated
4402
Include/internal/pycore_runtime_init_generated.h
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue