diff options
author | Victor Stinner <vstinner@python.org> | 2022-02-25 15:22:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-25 15:22:00 (GMT) |
commit | 87af12bff33b3e7546fa26158b7d8680ecb6ecec (patch) | |
tree | e51866d5b4f968074beadf3ada9da856601a43d4 /Objects/frameobject.c | |
parent | f780d9690f1a009a56ac0c653ec9608e6b2aeff4 (diff) | |
download | cpython-87af12bff33b3e7546fa26158b7d8680ecb6ecec.zip cpython-87af12bff33b3e7546fa26158b7d8680ecb6ecec.tar.gz cpython-87af12bff33b3e7546fa26158b7d8680ecb6ecec.tar.bz2 |
bpo-46836: Rename InterpreterFrame to _PyInterpreterFrame (GH-31583)
Rename also struct _interpreter_frame to struct _PyInterpreterFrame.
Reduce risk of name conflicts if a project includes pycore_frame.h.
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r-- | Objects/frameobject.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index c9445e3..eb7fdb3 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -629,8 +629,8 @@ frame_dealloc(PyFrameObject *f) /* Kill all local variables including specials, if we own them */ if (f->f_owns_frame) { f->f_owns_frame = 0; - assert(f->f_frame == (InterpreterFrame *)f->_f_frame_data); - InterpreterFrame *frame = (InterpreterFrame *)f->_f_frame_data; + assert(f->f_frame == (_PyInterpreterFrame *)f->_f_frame_data); + _PyInterpreterFrame *frame = (_PyInterpreterFrame *)f->_f_frame_data; /* Don't clear code object until the end */ co = frame->f_code; frame->f_code = NULL; @@ -707,7 +707,7 @@ static PyObject * frame_sizeof(PyFrameObject *f, PyObject *Py_UNUSED(ignored)) { Py_ssize_t res; - res = offsetof(PyFrameObject, _f_frame_data) + offsetof(InterpreterFrame, localsplus); + res = offsetof(PyFrameObject, _f_frame_data) + offsetof(_PyInterpreterFrame, localsplus); PyCodeObject *code = f->f_frame->f_code; res += (code->co_nlocalsplus+code->co_stacksize) * sizeof(PyObject *); return PyLong_FromSsize_t(res); @@ -738,7 +738,7 @@ PyTypeObject PyFrame_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "frame", offsetof(PyFrameObject, _f_frame_data) + - offsetof(InterpreterFrame, localsplus), + offsetof(_PyInterpreterFrame, localsplus), sizeof(PyObject *), (destructor)frame_dealloc, /* tp_dealloc */ 0, /* tp_vectorcall_offset */ @@ -771,7 +771,7 @@ PyTypeObject PyFrame_Type = { }; static void -init_frame(InterpreterFrame *frame, PyFunctionObject *func, PyObject *locals) +init_frame(_PyInterpreterFrame *frame, PyFunctionObject *func, PyObject *locals) { /* _PyFrame_InitializeSpecials consumes reference to func */ Py_INCREF(func); @@ -827,8 +827,8 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, Py_DECREF(func); return NULL; } - init_frame((InterpreterFrame *)f->_f_frame_data, func, locals); - f->f_frame = (InterpreterFrame *)f->_f_frame_data; + init_frame((_PyInterpreterFrame *)f->_f_frame_data, func, locals); + f->f_frame = (_PyInterpreterFrame *)f->_f_frame_data; f->f_owns_frame = 1; Py_DECREF(func); _PyObject_GC_TRACK(f); @@ -836,7 +836,7 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, } static int -_PyFrame_OpAlreadyRan(InterpreterFrame *frame, int opcode, int oparg) +_PyFrame_OpAlreadyRan(_PyInterpreterFrame *frame, int opcode, int oparg) { const _Py_CODEUNIT *code = (const _Py_CODEUNIT *)PyBytes_AS_STRING(frame->f_code->co_code); @@ -849,7 +849,7 @@ _PyFrame_OpAlreadyRan(InterpreterFrame *frame, int opcode, int oparg) } int -_PyFrame_FastToLocalsWithError(InterpreterFrame *frame) { +_PyFrame_FastToLocalsWithError(_PyInterpreterFrame *frame) { /* Merge fast locals into f->f_locals */ PyObject *locals; PyObject **fast; @@ -960,7 +960,7 @@ PyFrame_FastToLocals(PyFrameObject *f) } void -_PyFrame_LocalsToFast(InterpreterFrame *frame, int clear) +_PyFrame_LocalsToFast(_PyInterpreterFrame *frame, int clear) { /* Merge locals into fast locals */ PyObject *locals; |