File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -609,12 +609,18 @@ PyAPI_DATA(const struct _PyCode8) _Py_InitCleanup;
609
609
610
610
#ifdef Py_GIL_DISABLED
611
611
612
+ static inline _PyCodeArray *
613
+ _PyCode_GetTLBCArray (PyCodeObject * co )
614
+ {
615
+ return _Py_CAST (_PyCodeArray * , _Py_atomic_load_ptr_acquire (& co -> co_tlbc ));
616
+ }
617
+
612
618
// Return a pointer to the thread-local bytecode for the current thread, if it
613
619
// exists.
614
620
static inline _Py_CODEUNIT *
615
621
_PyCode_GetTLBCFast (PyThreadState * tstate , PyCodeObject * co )
616
622
{
617
- _PyCodeArray * code = _Py_atomic_load_ptr_acquire ( & co -> co_tlbc );
623
+ _PyCodeArray * code = _PyCode_GetTLBCArray ( co );
618
624
int32_t idx = ((_PyThreadStateImpl * ) tstate )-> tlbc_index ;
619
625
if (idx < code -> size && code -> entries [idx ] != NULL ) {
620
626
return (_Py_CODEUNIT * ) code -> entries [idx ];
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ _PyFrame_GetBytecode(_PyInterpreterFrame *f)
93
93
{
94
94
#ifdef Py_GIL_DISABLED
95
95
PyCodeObject * co = _PyFrame_GetCode (f );
96
- _PyCodeArray * tlbc = _Py_atomic_load_ptr_acquire ( & co -> co_tlbc );
96
+ _PyCodeArray * tlbc = _PyCode_GetTLBCArray ( co );
97
97
assert (f -> tlbc_index >= 0 && f -> tlbc_index < tlbc -> size );
98
98
return (_Py_CODEUNIT * )tlbc -> entries [f -> tlbc_index ];
99
99
#else
You can’t perform that action at this time.
0 commit comments