@@ -9,7 +9,7 @@ extern "C" {
99struct _frame {
1010 PyObject_HEAD
1111 PyFrameObject * f_back ; /* previous frame, or NULL */
12- struct _interpreter_frame * f_frame ; /* points to the frame data */
12+ struct _PyInterpreterFrame * f_frame ; /* points to the frame data */
1313 PyObject * f_trace ; /* Trace function */
1414 int f_lineno ; /* Current line number. Only valid if non-zero */
1515 char f_trace_lines ; /* Emit per-line trace events? */
@@ -48,63 +48,63 @@ typedef signed char PyFrameState;
4848 unless it's -1 in which case next_instr should be first_instr.
4949*/
5050
51- typedef struct _interpreter_frame {
51+ typedef struct _PyInterpreterFrame {
5252 PyFunctionObject * f_func ; /* Strong reference */
5353 PyObject * f_globals ; /* Borrowed reference */
5454 PyObject * f_builtins ; /* Borrowed reference */
5555 PyObject * f_locals ; /* Strong reference, may be NULL */
5656 PyCodeObject * f_code ; /* Strong reference */
5757 PyFrameObject * frame_obj ; /* Strong reference, may be NULL */
58- struct _interpreter_frame * previous ;
58+ struct _PyInterpreterFrame * previous ;
5959 int f_lasti ; /* Last instruction if called */
6060 int stacktop ; /* Offset of TOS from localsplus */
6161 PyFrameState f_state ; /* What state the frame is in */
6262 bool is_entry ; // Whether this is the "root" frame for the current CFrame.
6363 bool is_generator ;
6464 PyObject * localsplus [1 ];
65- } InterpreterFrame ;
65+ } _PyInterpreterFrame ;
6666
67- static inline int _PyFrame_IsRunnable (InterpreterFrame * f ) {
67+ static inline int _PyFrame_IsRunnable (_PyInterpreterFrame * f ) {
6868 return f -> f_state < FRAME_EXECUTING ;
6969}
7070
71- static inline int _PyFrame_IsExecuting (InterpreterFrame * f ) {
71+ static inline int _PyFrame_IsExecuting (_PyInterpreterFrame * f ) {
7272 return f -> f_state == FRAME_EXECUTING ;
7373}
7474
75- static inline int _PyFrameHasCompleted (InterpreterFrame * f ) {
75+ static inline int _PyFrameHasCompleted (_PyInterpreterFrame * f ) {
7676 return f -> f_state > FRAME_EXECUTING ;
7777}
7878
79- static inline PyObject * * _PyFrame_Stackbase (InterpreterFrame * f ) {
79+ static inline PyObject * * _PyFrame_Stackbase (_PyInterpreterFrame * f ) {
8080 return f -> localsplus + f -> f_code -> co_nlocalsplus ;
8181}
8282
83- static inline PyObject * _PyFrame_StackPeek (InterpreterFrame * f ) {
83+ static inline PyObject * _PyFrame_StackPeek (_PyInterpreterFrame * f ) {
8484 assert (f -> stacktop > f -> f_code -> co_nlocalsplus );
8585 assert (f -> localsplus [f -> stacktop - 1 ] != NULL );
8686 return f -> localsplus [f -> stacktop - 1 ];
8787}
8888
89- static inline PyObject * _PyFrame_StackPop (InterpreterFrame * f ) {
89+ static inline PyObject * _PyFrame_StackPop (_PyInterpreterFrame * f ) {
9090 assert (f -> stacktop > f -> f_code -> co_nlocalsplus );
9191 f -> stacktop -- ;
9292 return f -> localsplus [f -> stacktop ];
9393}
9494
95- static inline void _PyFrame_StackPush (InterpreterFrame * f , PyObject * value ) {
95+ static inline void _PyFrame_StackPush (_PyInterpreterFrame * f , PyObject * value ) {
9696 f -> localsplus [f -> stacktop ] = value ;
9797 f -> stacktop ++ ;
9898}
9999
100- #define FRAME_SPECIALS_SIZE ((sizeof(InterpreterFrame )-1)/sizeof(PyObject *))
100+ #define FRAME_SPECIALS_SIZE ((sizeof(_PyInterpreterFrame )-1)/sizeof(PyObject *))
101101
102- void _PyFrame_Copy (InterpreterFrame * src , InterpreterFrame * dest );
102+ void _PyFrame_Copy (_PyInterpreterFrame * src , _PyInterpreterFrame * dest );
103103
104104/* Consumes reference to func */
105105static inline void
106106_PyFrame_InitializeSpecials (
107- InterpreterFrame * frame , PyFunctionObject * func ,
107+ _PyInterpreterFrame * frame , PyFunctionObject * func ,
108108 PyObject * locals , int nlocalsplus )
109109{
110110 frame -> f_func = func ;
@@ -124,33 +124,33 @@ _PyFrame_InitializeSpecials(
124124 * that precedes this frame.
125125 */
126126static inline PyObject * *
127- _PyFrame_GetLocalsArray (InterpreterFrame * frame )
127+ _PyFrame_GetLocalsArray (_PyInterpreterFrame * frame )
128128{
129129 return frame -> localsplus ;
130130}
131131
132132static inline PyObject * *
133- _PyFrame_GetStackPointer (InterpreterFrame * frame )
133+ _PyFrame_GetStackPointer (_PyInterpreterFrame * frame )
134134{
135135 return frame -> localsplus + frame -> stacktop ;
136136}
137137
138138static inline void
139- _PyFrame_SetStackPointer (InterpreterFrame * frame , PyObject * * stack_pointer )
139+ _PyFrame_SetStackPointer (_PyInterpreterFrame * frame , PyObject * * stack_pointer )
140140{
141141 frame -> stacktop = (int )(stack_pointer - frame -> localsplus );
142142}
143143
144144/* For use by _PyFrame_GetFrameObject
145145 Do not call directly. */
146146PyFrameObject *
147- _PyFrame_MakeAndSetFrameObject (InterpreterFrame * frame );
147+ _PyFrame_MakeAndSetFrameObject (_PyInterpreterFrame * frame );
148148
149149/* Gets the PyFrameObject for this frame, lazily
150150 * creating it if necessary.
151151 * Returns a borrowed referennce */
152152static inline PyFrameObject *
153- _PyFrame_GetFrameObject (InterpreterFrame * frame )
153+ _PyFrame_GetFrameObject (_PyInterpreterFrame * frame )
154154{
155155 PyFrameObject * res = frame -> frame_obj ;
156156 if (res != NULL ) {
@@ -160,7 +160,7 @@ _PyFrame_GetFrameObject(InterpreterFrame *frame)
160160}
161161
162162/* Clears all references in the frame.
163- * If take is non-zero, then the InterpreterFrame frame
163+ * If take is non-zero, then the _PyInterpreterFrame frame
164164 * may be transferred to the frame object it references
165165 * instead of being cleared. Either way
166166 * the caller no longer owns the references
@@ -169,21 +169,21 @@ _PyFrame_GetFrameObject(InterpreterFrame *frame)
169169 * frames like the ones in generators and coroutines.
170170 */
171171void
172- _PyFrame_Clear (InterpreterFrame * frame );
172+ _PyFrame_Clear (_PyInterpreterFrame * frame );
173173
174174int
175- _PyFrame_Traverse (InterpreterFrame * frame , visitproc visit , void * arg );
175+ _PyFrame_Traverse (_PyInterpreterFrame * frame , visitproc visit , void * arg );
176176
177177int
178- _PyFrame_FastToLocalsWithError (InterpreterFrame * frame );
178+ _PyFrame_FastToLocalsWithError (_PyInterpreterFrame * frame );
179179
180180void
181- _PyFrame_LocalsToFast (InterpreterFrame * frame , int clear );
181+ _PyFrame_LocalsToFast (_PyInterpreterFrame * frame , int clear );
182182
183- extern InterpreterFrame *
183+ extern _PyInterpreterFrame *
184184_PyThreadState_BumpFramePointerSlow (PyThreadState * tstate , size_t size );
185185
186- static inline InterpreterFrame *
186+ static inline _PyInterpreterFrame *
187187_PyThreadState_BumpFramePointer (PyThreadState * tstate , size_t size )
188188{
189189 PyObject * * base = tstate -> datastack_top ;
@@ -192,16 +192,16 @@ _PyThreadState_BumpFramePointer(PyThreadState *tstate, size_t size)
192192 assert (tstate -> datastack_limit );
193193 if (top < tstate -> datastack_limit ) {
194194 tstate -> datastack_top = top ;
195- return (InterpreterFrame * )base ;
195+ return (_PyInterpreterFrame * )base ;
196196 }
197197 }
198198 return _PyThreadState_BumpFramePointerSlow (tstate , size );
199199}
200200
201- void _PyThreadState_PopFrame (PyThreadState * tstate , InterpreterFrame * frame );
201+ void _PyThreadState_PopFrame (PyThreadState * tstate , _PyInterpreterFrame * frame );
202202
203203/* Consume reference to func */
204- InterpreterFrame *
204+ _PyInterpreterFrame *
205205_PyFrame_Push (PyThreadState * tstate , PyFunctionObject * func );
206206
207207#ifdef __cplusplus
0 commit comments