GH-94851: check refcnt of immortal objects after finalization (GH-95001)

This commit is contained in:
Kumar Aditya 2022-07-25 23:13:59 +05:30 committed by GitHub
parent ac6a94c669
commit 73ee5a6b86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4430 additions and 1 deletions

View file

@ -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) \

File diff suppressed because it is too large Load diff