Add more stats for freelist use and allocations. (GH-92211)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user