mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Add more stats for freelist use and allocations. (GH-92211)
This commit is contained in:
parent
e8d7661ff2
commit
836b17c9c3
9 changed files with 43 additions and 0 deletions
|
@ -158,6 +158,7 @@ PyList_New(Py_ssize_t size)
|
|||
if (PyList_MAXFREELIST && state->numfree) {
|
||||
state->numfree--;
|
||||
op = state->free_list[state->numfree];
|
||||
OBJECT_STAT_INC(from_freelist);
|
||||
_Py_NewReference((PyObject *)op);
|
||||
}
|
||||
else
|
||||
|
@ -353,6 +354,7 @@ list_dealloc(PyListObject *op)
|
|||
#endif
|
||||
if (state->numfree < PyList_MAXFREELIST && PyList_CheckExact(op)) {
|
||||
state->free_list[state->numfree++] = op;
|
||||
OBJECT_STAT_INC(to_freelist);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue