mirror of
https://github.com/python/cpython.git
synced 2025-10-14 10:53:40 +00:00
gh-123619: Add an unstable C API function for enabling deferred reference counting (GH-123635)
Co-authored-by: Sam Gross <colesbury@gmail.com>
This commit is contained in:
parent
29b5323c45
commit
d00878b06a
8 changed files with 128 additions and 1 deletions
|
@ -2069,6 +2069,14 @@ identify_type_slot_wrappers(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
return _PyType_GetSlotWrapperNames();
|
||||
}
|
||||
|
||||
|
||||
static PyObject *
|
||||
has_deferred_refcount(PyObject *self, PyObject *op)
|
||||
{
|
||||
return PyBool_FromLong(_PyObject_HasDeferredRefcount(op));
|
||||
}
|
||||
|
||||
|
||||
static PyMethodDef module_functions[] = {
|
||||
{"get_configs", get_configs, METH_NOARGS},
|
||||
{"get_recursion_depth", get_recursion_depth, METH_NOARGS},
|
||||
|
@ -2165,6 +2173,7 @@ static PyMethodDef module_functions[] = {
|
|||
GH_119213_GETARGS_METHODDEF
|
||||
{"get_static_builtin_types", get_static_builtin_types, METH_NOARGS},
|
||||
{"identify_type_slot_wrappers", identify_type_slot_wrappers, METH_NOARGS},
|
||||
{"has_deferred_refcount", has_deferred_refcount, METH_O},
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue