@@ -52,9 +52,13 @@ extern "C" {
5252#ifdef Py_GIL_DISABLED
5353# define _Py_Debug_gilruntimestate_enabled offsetof(struct _gil_runtime_state, enabled)
5454# define _Py_Debug_Free_Threaded 1
55+ # define _Py_Debug_code_object_co_tlbc offsetof(PyCodeObject, co_tlbc)
56+ # define _Py_Debug_interpreter_frame_tlbc_index offsetof(_PyInterpreterFrame, tlbc_index)
5557#else
5658# define _Py_Debug_gilruntimestate_enabled 0
5759# define _Py_Debug_Free_Threaded 0
60+ # define _Py_Debug_code_object_co_tlbc 0
61+ # define _Py_Debug_interpreter_frame_tlbc_index 0
5862#endif
5963
6064
@@ -110,6 +114,7 @@ typedef struct _Py_DebugOffsets {
110114 uint64_t localsplus ;
111115 uint64_t owner ;
112116 uint64_t stackpointer ;
117+ uint64_t tlbc_index ;
113118 } interpreter_frame ;
114119
115120 // Code object offset;
@@ -124,6 +129,7 @@ typedef struct _Py_DebugOffsets {
124129 uint64_t localsplusnames ;
125130 uint64_t localspluskinds ;
126131 uint64_t co_code_adaptive ;
132+ uint64_t co_tlbc ;
127133 } code_object ;
128134
129135 // PyObject offset;
@@ -272,6 +278,7 @@ typedef struct _Py_DebugOffsets {
272278 .localsplus = offsetof(_PyInterpreterFrame, localsplus), \
273279 .owner = offsetof(_PyInterpreterFrame, owner), \
274280 .stackpointer = offsetof(_PyInterpreterFrame, stackpointer), \
281+ .tlbc_index = _Py_Debug_interpreter_frame_tlbc_index, \
275282 }, \
276283 .code_object = { \
277284 .size = sizeof(PyCodeObject), \
@@ -284,6 +291,7 @@ typedef struct _Py_DebugOffsets {
284291 .localsplusnames = offsetof(PyCodeObject, co_localsplusnames), \
285292 .localspluskinds = offsetof(PyCodeObject, co_localspluskinds), \
286293 .co_code_adaptive = offsetof(PyCodeObject, co_code_adaptive), \
294+ .co_tlbc = _Py_Debug_code_object_co_tlbc, \
287295 }, \
288296 .pyobject = { \
289297 .size = sizeof(PyObject), \
0 commit comments