mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-106320: Remove private _PyInterpreterState functions (#106325)
Remove private _PyThreadState and _PyInterpreterState C API functions: move them to the internal C API (pycore_pystate.h and pycore_interp.h). Don't export most of these functions anymore, but still export functions used by tests. Remove _PyThreadState_Prealloc() and _PyThreadState_Init() from the C API, but keep it in the stable API.
This commit is contained in:
parent
feb51f3a64
commit
8571b271e7
9 changed files with 86 additions and 70 deletions
|
@ -1166,7 +1166,7 @@ PyInterpreterState_GetDict(PyInterpreterState *interp)
|
|||
The GIL must be held.
|
||||
*/
|
||||
|
||||
PyInterpreterState *
|
||||
PyInterpreterState*
|
||||
PyInterpreterState_Get(void)
|
||||
{
|
||||
PyThreadState *tstate = current_fast_get(&_PyRuntime);
|
||||
|
@ -1408,7 +1408,7 @@ _PyThreadState_New(PyInterpreterState *interp)
|
|||
}
|
||||
|
||||
// We keep this for stable ABI compabibility.
|
||||
PyThreadState *
|
||||
PyAPI_FUNC(PyThreadState*)
|
||||
_PyThreadState_Prealloc(PyInterpreterState *interp)
|
||||
{
|
||||
return _PyThreadState_New(interp);
|
||||
|
@ -1416,7 +1416,7 @@ _PyThreadState_Prealloc(PyInterpreterState *interp)
|
|||
|
||||
// We keep this around for (accidental) stable ABI compatibility.
|
||||
// Realistically, no extensions are using it.
|
||||
void
|
||||
PyAPI_FUNC(void)
|
||||
_PyThreadState_Init(PyThreadState *tstate)
|
||||
{
|
||||
Py_FatalError("_PyThreadState_Init() is for internal use only");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue