mirror of
https://github.com/python/cpython.git
synced 2025-11-09 10:01:42 +00:00
GH-84436: Skip refcounting for known immortals (GH-107605)
This commit is contained in:
parent
ec0a0d2bd9
commit
05a824f294
19 changed files with 52 additions and 65 deletions
|
|
@ -831,8 +831,8 @@ func_clear(PyFunctionObject *op)
|
|||
// However, name and qualname could be str subclasses, so they
|
||||
// could have reference cycles. The solution is to replace them
|
||||
// with a genuinely immutable string.
|
||||
Py_SETREF(op->func_name, Py_NewRef(&_Py_STR(empty)));
|
||||
Py_SETREF(op->func_qualname, Py_NewRef(&_Py_STR(empty)));
|
||||
Py_SETREF(op->func_name, &_Py_STR(empty));
|
||||
Py_SETREF(op->func_qualname, &_Py_STR(empty));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue