mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
gh-111354: Simplify _PyGen_yf by moving some of its work to the compiler and frame state (#111648)
This commit is contained in:
parent
7810b6981a
commit
d49aba5a7a
16 changed files with 342 additions and 338 deletions
|
|
@ -36,13 +36,16 @@ extern PyFrameObject* _PyFrame_New_NoTrack(PyCodeObject *code);
|
|||
/* other API */
|
||||
|
||||
typedef enum _framestate {
|
||||
FRAME_CREATED = -2,
|
||||
FRAME_SUSPENDED = -1,
|
||||
FRAME_CREATED = -3,
|
||||
FRAME_SUSPENDED = -2,
|
||||
FRAME_SUSPENDED_YIELD_FROM = -1,
|
||||
FRAME_EXECUTING = 0,
|
||||
FRAME_COMPLETED = 1,
|
||||
FRAME_CLEARED = 4
|
||||
} PyFrameState;
|
||||
|
||||
#define FRAME_STATE_SUSPENDED(S) ((S) == FRAME_SUSPENDED || (S) == FRAME_SUSPENDED_YIELD_FROM)
|
||||
|
||||
enum _frameowner {
|
||||
FRAME_OWNED_BY_THREAD = 0,
|
||||
FRAME_OWNED_BY_GENERATOR = 1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue