Message335122
(also see issue #35886)
In November Victor created the Include/cpython directory and moved a decent amount of public (but not limited) API there. This included the PyThreadState struct. I'd like to move it into the "internal" headers since it is somewhat coupled to the internal runtime implementation. The alternative is extra complexity. I ran into this while working on another issue.
There are 2 problems, however, with PyThreadState which make a move potentially challenging. In fact, they could be (but probably aren't) cause for moving it back to Include/pystate.h.
1. the docs say: "The only public data member is PyInterpreterState *interp, which points to this thread’s interpreter state."
2. the struct has 6 fields that are exposed (likely unintentionally) in "stable" header files via the following macros:
# Include/object.h
Py_TRASHCAN_SAFE_BEGIN
Py_TRASHCAN_SAFE_END
Include.ceval.h
Py_EnterRecursiveCall
Py_LeaveRecursiveCall
_Py_MakeRecCheck
Py_ALLOW_RECURSION
Py_END_ALLOW_RECURSION
I'm not sure how that factors into the stable ABI (PyThreadState wasn't ever guarded by Py_LIMITED_API). However, keep in mind that Victor already moved PyThreadState out of the "stable" headers in November.
I'm fine with sorting out the situation with the macros if that's okay to do. Likewise the promised field ("interp") should be solvable one way or another (e.g. remove it or use a private struct).
...or we could do nothing or (if the change in Novemver is a problem) move it back to Include/pystate.h. |
|
Date |
User |
Action |
Args |
2019-02-09 02:00:22 | eric.snow | set | recipients:
+ eric.snow, ncoghlan, vstinner |
2019-02-09 02:00:19 | eric.snow | set | messageid: <1549677619.84.0.322696563838.issue35949@roundup.psfhosted.org> |
2019-02-09 02:00:19 | eric.snow | link | issue35949 messages |
2019-02-09 02:00:19 | eric.snow | create | |
|