bpo-38644: Add _PyEval_EvalFrame() with tstate (GH-17131)

Add _PyEval_EvalFrame() static inline function to get eval_frame from
tstate->interp.
This commit is contained in:
Victor Stinner 2019-11-14 12:20:46 +01:00 committed by GitHub
parent 3ccdd9b180
commit b9e681261c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 7 deletions

View file

@ -11,6 +11,9 @@ extern "C" {
/* Forward declarations */
struct pyruntimestate;
struct _ceval_runtime_state;
struct _frame;
#include "pycore_pystate.h" /* PyInterpreterState.eval_frame */
PyAPI_FUNC(void) _Py_FinishPendingCalls(struct pyruntimestate *runtime);
PyAPI_FUNC(void) _PyEval_Initialize(struct _ceval_runtime_state *);
@ -34,6 +37,12 @@ PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth(
/* Private function */
void _PyEval_Fini(void);
static inline PyObject*
_PyEval_EvalFrame(PyThreadState *tstate, struct _frame *f, int throwflag)
{
return tstate->interp->eval_frame(f, throwflag);
}
#ifdef __cplusplus
}
#endif