Message371277
This change combines the explicit state in `PyFrameObject.f_excuting` and `PyGenObject.gi_running`, and the implicit state in `PyFrameObject.f_stacktop == NULL` and `PyFrameObject.f_last == -1` into a single enum field in `PyFrameObject`.
Since we no longer need to test `PyFrameObject.f_stacktop == NULL` , The `f_stacktop` pointer can be replaced with a `f_stackdepth` integer, which make for simpler code when iterating over the stack and avoids the potential hazard of NULL pointers.
There are three benefits to these changes:
1. The code is more robust and, IMO, easier to understand, as all state is now explicit.
2. It carries additional information about the state of the frame. Information about whether a frame exiting by `return` or by `raise` is available.
3. A modest reduction in size of frame and generator objects. |
|
Date |
User |
Action |
Args |
2020-06-11 13:27:24 | Mark.Shannon | set | recipients:
+ Mark.Shannon |
2020-06-11 13:27:24 | Mark.Shannon | set | messageid: <1591882044.52.0.325483570174.issue40941@roundup.psfhosted.org> |
2020-06-11 13:27:24 | Mark.Shannon | link | issue40941 messages |
2020-06-11 13:27:24 | Mark.Shannon | create | |
|