summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-05-03 22:40:24 (GMT)
committerGitHub <noreply@github.com>2022-05-03 22:40:24 (GMT)
commit836b17c9c3ea313e400e58a75f52b63f96e498bb (patch)
tree8b1a1c9e2466fa72ceee01558e76989b35c8bd56 /Objects/genobject.c
parente8d7661ff25fb698062ab07e37362c2c20471984 (diff)
downloadcpython-836b17c9c3ea313e400e58a75f52b63f96e498bb.zip
cpython-836b17c9c3ea313e400e58a75f52b63f96e498bb.tar.gz
cpython-836b17c9c3ea313e400e58a75f52b63f96e498bb.tar.bz2
Add more stats for freelist use and allocations. (GH-92211)
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 0a4b43e..b9a0c30 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -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);
}