mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
gh-114312: Collect stats for unlikely events (GH-114493)
This commit is contained in:
parent
c63c6142f9
commit
ea3cd0498c
11 changed files with 199 additions and 1 deletions
|
@ -1371,6 +1371,7 @@ type_set_bases(PyTypeObject *type, PyObject *new_bases, void *context)
|
|||
res = 0;
|
||||
}
|
||||
|
||||
RARE_EVENT_INC(set_bases);
|
||||
Py_DECREF(old_bases);
|
||||
Py_DECREF(old_base);
|
||||
|
||||
|
@ -5842,6 +5843,8 @@ object_set_class(PyObject *self, PyObject *value, void *closure)
|
|||
Py_SET_TYPE(self, newto);
|
||||
if (oldto->tp_flags & Py_TPFLAGS_HEAPTYPE)
|
||||
Py_DECREF(oldto);
|
||||
|
||||
RARE_EVENT_INC(set_class);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue