Add more stats for freelist use and allocations. (GH-92211)

This commit is contained in:
Mark Shannon 2022-05-03 16:40:24 -06:00 committed by GitHub
parent e8d7661ff2
commit 836b17c9c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 43 additions and 0 deletions

View file

@ -141,6 +141,7 @@ PyFloat_FromDouble(double fval)
#endif
state->free_list = (PyFloatObject *) Py_TYPE(op);
state->numfree--;
OBJECT_STAT_INC(from_freelist);
}
else
#endif
@ -256,6 +257,7 @@ _PyFloat_ExactDealloc(PyObject *obj)
state->numfree++;
Py_SET_TYPE(op, (PyTypeObject *)state->free_list);
state->free_list = op;
OBJECT_STAT_INC(to_freelist);
#else
PyObject_Free(op);
#endif