[New-bugs-announce] [issue47215] Add "unstable" frame stack api

Mark Shannon report at bugs.python.org
Mon Apr 4 07:59:07 EDT 2022


New submission from Mark Shannon <mark at hotpy.org>:

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);

```

----------
assignee: Mark.Shannon
components: C API
messages: 416665
nosy: Mark.Shannon, brandtbucher
priority: normal
severity: normal
stage: needs patch
status: open
title: Add "unstable" frame stack api
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47215>
_______________________________________


More information about the New-bugs-announce mailing list