mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -1942,6 +1942,7 @@ async_gen_wrapped_val_dealloc(_PyAsyncGenWrappedValue *o)
|
|||
if (state->value_numfree < _PyAsyncGen_MAXFREELIST) {
|
||||
assert(_PyAsyncGenWrappedValue_CheckExact(o));
|
||||
state->value_freelist[state->value_numfree++] = o;
|
||||
OBJECT_STAT_INC(to_freelist);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -2018,6 +2019,7 @@ _PyAsyncGenValueWrapperNew(PyObject *val)
|
|||
if (state->value_numfree) {
|
||||
state->value_numfree--;
|
||||
o = state->value_freelist[state->value_numfree];
|
||||
OBJECT_STAT_INC(from_freelist);
|
||||
assert(_PyAsyncGenWrappedValue_CheckExact(o));
|
||||
_Py_NewReference((PyObject*)o);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue