Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "unstable" frame stack api #91371

Open
markshannon opened this issue Apr 4, 2022 · 1 comment
Open

Add "unstable" frame stack api #91371

markshannon opened this issue Apr 4, 2022 · 1 comment
Assignees
Labels
3.11 bug and security fixes topic-C-API type-feature A feature request or enhancement

Comments

@markshannon
Copy link
Member

BPO 47215
Nosy @markshannon, @brandtbucher
PRs
  • bpo-47215: Add undocumented, unstable FrameStack API for use by greenlets and similar libraries. #32303
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/markshannon'
    closed_at = None
    created_at = <Date 2022-04-04.11:59:07.553>
    labels = ['expert-C-API', 'type-feature', '3.11']
    title = 'Add "unstable" frame stack api'
    updated_at = <Date 2022-04-04.12:09:47.075>
    user = 'https://github.com/markshannon'

    bugs.python.org fields:

    activity = <Date 2022-04-04.12:09:47.075>
    actor = 'Mark.Shannon'
    assignee = 'Mark.Shannon'
    closed = False
    closed_date = None
    closer = None
    components = ['C API']
    creation = <Date 2022-04-04.11:59:07.553>
    creator = 'Mark.Shannon'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47215
    keywords = ['patch']
    message_count = 1.0
    messages = ['416665']
    nosy_count = 2.0
    nosy_names = ['Mark.Shannon', 'brandtbucher']
    pr_nums = ['32303']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue47215'
    versions = ['Python 3.11']

    @markshannon
    Copy link
    Member Author

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

    @markshannon markshannon added the 3.11 bug and security fixes label Apr 4, 2022
    @markshannon markshannon self-assigned this Apr 4, 2022
    @markshannon markshannon added topic-C-API type-feature A feature request or enhancement 3.11 bug and security fixes labels Apr 4, 2022
    @markshannon markshannon self-assigned this Apr 4, 2022
    @markshannon markshannon added topic-C-API type-feature A feature request or enhancement labels Apr 4, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 bug and security fixes topic-C-API type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant