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:
Eric Snow 2024-03-21 09:56:12 -06:00 committed by GitHub
parent e728303532
commit bbee57fa8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 143 additions and 178 deletions

View file

@ -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 *);