bpo-45963: Make space for the InterpreterFrame of a generator in that generator. (GH-29891)

* Make generator, coroutine and async gen structs all the same size.

* Store interpreter frame in generator (and coroutine). Reduces the number of allocations neeeded for a generator from two to one.
This commit is contained in:
Mark Shannon 2021-12-06 10:13:49 +00:00 committed by GitHub
parent f34d181fa1
commit 299483c95d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 128 additions and 145 deletions

View file

@ -113,7 +113,7 @@ static inline void _Py_LeaveRecursiveCall_inline(void) {
struct _interpreter_frame *_PyEval_GetFrame(void);
PyObject *_Py_MakeCoro(PyFunctionObject *func, struct _interpreter_frame *);
PyObject *_Py_MakeCoro(PyFunctionObject *func);
#ifdef __cplusplus
}