aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/context.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-05-03 16:40:24 -0600
committerGitHub <noreply@github.com>2022-05-03 16:40:24 -0600
commit836b17c9c3ea313e400e58a75f52b63f96e498bb (patch)
tree8b1a1c9e2466fa72ceee01558e76989b35c8bd56 /Python/context.c
parente8d7661ff25fb698062ab07e37362c2c20471984 (diff)
downloadcpython-836b17c9c3ea313e400e58a75f52b63f96e498bb.tar.gz
cpython-836b17c9c3ea313e400e58a75f52b63f96e498bb.zip
Add more stats for freelist use and allocations. (GH-92211)
Diffstat (limited to 'Python/context.c')
-rw-r--r--Python/context.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/context.c b/Python/context.c
index a77cd14544e..ef9db6a9cd0 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -351,6 +351,7 @@ _context_alloc(void)
state->numfree--;
ctx = state->freelist;
state->freelist = (PyContext *)ctx->ctx_weakreflist;
+ OBJECT_STAT_INC(from_freelist);
ctx->ctx_weakreflist = NULL;
_Py_NewReference((PyObject *)ctx);
}
@@ -482,6 +483,7 @@ context_tp_dealloc(PyContext *self)
state->numfree++;
self->ctx_weakreflist = (PyObject *)state->freelist;
state->freelist = self;
+ OBJECT_STAT_INC(to_freelist);
}
else
#endif