mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-76785: Clean Up Interpreter ID Conversions (gh-117048)
Mostly we unify the two different implementations of the conversion code (from PyObject * to int64_t. We also drop the PyArg_ParseTuple()-style converter function, as well as rename and move PyInterpreterID_LookUp().
This commit is contained in:
parent
e728303532
commit
bbee57fa8c
8 changed files with 143 additions and 178 deletions
|
|
@ -8,4 +8,7 @@ PyAPI_DATA(PyTypeObject) PyInterpreterID_Type;
|
|||
|
||||
PyAPI_FUNC(PyObject *) PyInterpreterID_New(int64_t);
|
||||
PyAPI_FUNC(PyObject *) PyInterpreterState_GetIDObject(PyInterpreterState *);
|
||||
PyAPI_FUNC(PyInterpreterState *) PyInterpreterID_LookUp(PyObject *);
|
||||
|
||||
#ifdef Py_BUILD_CORE
|
||||
extern int64_t _PyInterpreterID_GetID(PyObject *);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -295,8 +295,11 @@ _PyInterpreterState_SetFinalizing(PyInterpreterState *interp, PyThreadState *tst
|
|||
}
|
||||
|
||||
|
||||
extern int64_t _PyInterpreterState_ObjectToID(PyObject *);
|
||||
|
||||
// Export for the _xxinterpchannels module.
|
||||
PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_LookUpID(int64_t);
|
||||
PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_LookUpIDObject(PyObject *);
|
||||
|
||||
PyAPI_FUNC(int) _PyInterpreterState_IDInitref(PyInterpreterState *);
|
||||
PyAPI_FUNC(int) _PyInterpreterState_IDIncref(PyInterpreterState *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue