mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
bpo-46072: Add some frame stats. (GH-31060)
This commit is contained in:
parent
a05866ce3e
commit
187930f74c
7 changed files with 16 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
|
||||
#include "Python.h"
|
||||
#include "frameobject.h"
|
||||
#include "pycore_code.h" // stats
|
||||
#include "pycore_frame.h"
|
||||
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
|
||||
#include "opcode.h"
|
||||
|
@ -113,6 +114,7 @@ _PyFrame_Push(PyThreadState *tstate, PyFunctionObject *func)
|
|||
{
|
||||
PyCodeObject *code = (PyCodeObject *)func->func_code;
|
||||
size_t size = code->co_nlocalsplus + code->co_stacksize + FRAME_SPECIALS_SIZE;
|
||||
CALL_STAT_INC(frames_pushed);
|
||||
InterpreterFrame *new_frame = _PyThreadState_BumpFramePointer(tstate, size);
|
||||
if (new_frame == NULL) {
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue