mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
bpo-39573: Add Py_SET_REFCNT() function (GH-18389)
Add a Py_SET_REFCNT() function to set the reference counter of an object.
This commit is contained in:
parent
a93c51e3a8
commit
c86a11221d
7 changed files with 30 additions and 14 deletions
|
@ -51,7 +51,7 @@ PyModuleDef_Init(struct PyModuleDef* def)
|
|||
return NULL;
|
||||
if (def->m_base.m_index == 0) {
|
||||
max_module_number++;
|
||||
Py_REFCNT(def) = 1;
|
||||
Py_SET_REFCNT(def, 1);
|
||||
Py_TYPE(def) = &PyModuleDef_Type;
|
||||
def->m_base.m_index = max_module_number;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue