-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-139653: Add PyUnstable_ThreadState_SetStack() #139668
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
base: main
Are you sure you want to change the base?
Conversation
Add PyUnstable_ThreadState_SetStack() and PyUnstable_ThreadState_ResetStack() functions to set the stack base address and stack size of a Python thread state.
This generally matches what I came up with :) The start argument might be confusing, as the place usage grows towards. |
Good!
APIs like
|
.. versionadded:: next | ||
.. c:function:: void PyUnstable_ThreadState_ResetStack(PyThreadState *tstate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of this name. Maybe PyUnstable_ThreadState_InitStack()
would be more explicit?
assert(ts->c_stack_soft_limit < ts->c_stack_top); | ||
|
||
// Test the stack pointer | ||
#if !defined(NDEBUG) && !defined(__wasi__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These assertions fail on WASI but I don't have time right now to investigate why.
Add PyUnstable_ThreadState_SetStack() and
PyUnstable_ThreadState_ResetStack() functions to set the stack base address and stack size of a Python thread state.
📚 Documentation preview 📚: https://cpython-previews--139668.org.readthedocs.build/