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