summaryrefslogtreecommitdiffstats
path: root/Python/frame.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-02-25 15:22:00 (GMT)
committerGitHub <noreply@github.com>2022-02-25 15:22:00 (GMT)
commit87af12bff33b3e7546fa26158b7d8680ecb6ecec (patch)
treee51866d5b4f968074beadf3ada9da856601a43d4 /Python/frame.c
parentf780d9690f1a009a56ac0c653ec9608e6b2aeff4 (diff)
downloadcpython-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 'Python/frame.c')
-rw-r--r--Python/frame.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Python/frame.c b/Python/frame.c
index 76697cf..20b4f81 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -7,7 +7,7 @@
#include "opcode.h"
int
-_PyFrame_Traverse(InterpreterFrame *frame, visitproc visit, void *arg)
+_PyFrame_Traverse(_PyInterpreterFrame *frame, visitproc visit, void *arg)
{
Py_VISIT(frame->frame_obj);
Py_VISIT(frame->f_locals);
@@ -24,7 +24,7 @@ _PyFrame_Traverse(InterpreterFrame *frame, visitproc visit, void *arg)
}
PyFrameObject *
-_PyFrame_MakeAndSetFrameObject(InterpreterFrame *frame)
+_PyFrame_MakeAndSetFrameObject(_PyInterpreterFrame *frame)
{
assert(frame->frame_obj == NULL);
PyObject *error_type, *error_value, *error_traceback;
@@ -46,7 +46,7 @@ _PyFrame_MakeAndSetFrameObject(InterpreterFrame *frame)
}
void
-_PyFrame_Copy(InterpreterFrame *src, InterpreterFrame *dest)
+_PyFrame_Copy(_PyInterpreterFrame *src, _PyInterpreterFrame *dest)
{
assert(src->stacktop >= src->f_code->co_nlocalsplus);
Py_ssize_t size = ((char*)&src->localsplus[src->stacktop]) - (char *)src;
@@ -55,17 +55,17 @@ _PyFrame_Copy(InterpreterFrame *src, InterpreterFrame *dest)
static void
-take_ownership(PyFrameObject *f, InterpreterFrame *frame)
+take_ownership(PyFrameObject *f, _PyInterpreterFrame *frame)
{
assert(f->f_owns_frame == 0);
Py_ssize_t size = ((char*)&frame->localsplus[frame->stacktop]) - (char *)frame;
- memcpy((InterpreterFrame *)f->_f_frame_data, frame, size);
- frame = (InterpreterFrame *)f->_f_frame_data;
+ memcpy((_PyInterpreterFrame *)f->_f_frame_data, frame, size);
+ frame = (_PyInterpreterFrame *)f->_f_frame_data;
f->f_owns_frame = 1;
f->f_frame = frame;
assert(f->f_back == NULL);
if (frame->previous != NULL) {
- /* Link PyFrameObjects.f_back and remove link through InterpreterFrame.previous */
+ /* Link PyFrameObjects.f_back and remove link through _PyInterpreterFrame.previous */
PyFrameObject *back = _PyFrame_GetFrameObject(frame->previous);
if (back == NULL) {
/* Memory error here. */
@@ -84,7 +84,7 @@ take_ownership(PyFrameObject *f, InterpreterFrame *frame)
}
void
-_PyFrame_Clear(InterpreterFrame *frame)
+_PyFrame_Clear(_PyInterpreterFrame *frame)
{
/* It is the responsibility of the owning generator/coroutine
* to have cleared the enclosing generator, if any. */
@@ -110,13 +110,13 @@ _PyFrame_Clear(InterpreterFrame *frame)
}
/* Consumes reference to func */
-InterpreterFrame *
+_PyInterpreterFrame *
_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);
+ _PyInterpreterFrame *new_frame = _PyThreadState_BumpFramePointer(tstate, size);
if (new_frame == NULL) {
Py_DECREF(func);
return NULL;