mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-124153: Implement PyType_GetBaseByToken() and Py_tp_token slot (GH-124163)
This commit is contained in:
parent
79a7410236
commit
646f16bdee
18 changed files with 443 additions and 13 deletions
|
|
@ -269,6 +269,7 @@ typedef struct _heaptypeobject {
|
|||
struct _dictkeysobject *ht_cached_keys;
|
||||
PyObject *ht_module;
|
||||
char *_ht_tpname; // Storage for "tp_name"; see PyType_FromModuleAndSpec
|
||||
void *ht_token; // Storage for the "Py_tp_token" slot
|
||||
struct _specialization_cache _spec_cache; // For use by the specializer.
|
||||
#ifdef Py_GIL_DISABLED
|
||||
Py_ssize_t unique_id; // ID used for thread-local refcounting
|
||||
|
|
|
|||
|
|
@ -391,6 +391,10 @@ PyAPI_FUNC(PyObject *) PyType_FromMetaclass(PyTypeObject*, PyObject*, PyType_Spe
|
|||
PyAPI_FUNC(void *) PyObject_GetTypeData(PyObject *obj, PyTypeObject *cls);
|
||||
PyAPI_FUNC(Py_ssize_t) PyType_GetTypeDataSize(PyTypeObject *cls);
|
||||
#endif
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030E0000
|
||||
PyAPI_FUNC(int) PyType_GetBaseByToken(PyTypeObject *, void *, PyTypeObject **);
|
||||
#define Py_TP_USE_SPEC NULL
|
||||
#endif
|
||||
|
||||
/* Generic type check */
|
||||
PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
|
||||
|
|
|
|||
|
|
@ -90,3 +90,7 @@
|
|||
/* New in 3.14 */
|
||||
#define Py_tp_vectorcall 82
|
||||
#endif
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030E0000
|
||||
/* New in 3.14 */
|
||||
#define Py_tp_token 83
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue