This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add "unstable" frame stack api
Type: enhancement Stage: patch review
Components: C API Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Mark.Shannon Nosy List: Mark.Shannon, brandtbucher
Priority: normal Keywords: patch

Created on 2022-04-04 11:59 by Mark.Shannon, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 32303 open Mark.Shannon, 2022-04-04 12:09
Messages (1)
msg416665 - (view) Author: Mark Shannon (Mark.Shannon) * (Python committer) Date: 2022-04-04 11:59
We need to provide an API to create, swap and free frame stacks for greenlets.

Since this is primarily for greenlets (and any other stackful coroutines libraries that want to use it) it will be "unstable".

In this case, by "unstable" I mean:
1. Starts with an underscore
2. Gets PyAPI_FUNC annotations, so we don't strip the symbols from the executable
3. Undocumented, except for comments that say it is unstable.

The API will be:

```
typedef struct _frame_stack {
    _PyStackChunk *current_chunk;
    PyObject **top;
    PyObject **limit;
    int chunk_size;
} _PyFrameStack;

PyAPI_FUNC(void) _PyFrameStack_Init(_PyFrameStack *fs, int chunk_size);
PyAPI_FUNC(void) _PyFrameStack_Swap(_PyFrameStack *fs);
PyAPI_FUNC(void) _PyFrameStack_Free(_PyFrameStack *fs);

```
History
Date User Action Args
2022-04-11 14:59:58adminsetgithub: 91371
2022-04-04 12:09:47Mark.Shannonsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request30366
2022-04-04 11:59:07Mark.Shannoncreate