Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add minimal documentation.
  • Loading branch information
markshannon committed Apr 4, 2022
commit f6a46a634ff0aad024c7a4386fe7338b53d31eaa
8 changes: 8 additions & 0 deletions Include/cpython/pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,15 @@ typedef int (*crossinterpdatafunc)(PyObject *, _PyCrossInterpreterData *);
PyAPI_FUNC(int) _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc);
PyAPI_FUNC(crossinterpdatafunc) _PyCrossInterpreterData_Lookup(PyObject *);

/* UNSTABLE API for stackful coroutines.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about hiding this behind an ifdef, it would technically be an api break, but would make the intention clearer:

#ifdef _PYTHON_C_UNSTABLE_FRAMESTACK_API
...
#endif

* It it the responsibility of the caller to manage the memory for the _PyFrameStack struct.
* The memory for the actual frame stack will be managed by the VM.
* All functions need the GIL to be held.
*/

/* Initialize fs with given chunk size */
PyAPI_FUNC(void) _PyFrameStack_Init(_PyFrameStack *fs, int chunk_size);
/* Swap the frame stack of the current thread with fs */
PyAPI_FUNC(void) _PyFrameStack_Swap(_PyFrameStack *fs);
/* Free any allocated memory chunks from fs. Does not free fs itself */
PyAPI_FUNC(void) _PyFrameStack_Free(_PyFrameStack *fs);