File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 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;
609609
610610#ifdef Py_GIL_DISABLED
611611
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+
612619// Return a pointer to the thread-local bytecode for the current thread, if it
613620// exists.
614621static inline _Py_CODEUNIT *
615622_PyCode_GetTLBCFast (PyThreadState * tstate , PyCodeObject * co )
616623{
617- _PyCodeArray * code = _Py_atomic_load_ptr_acquire ( & co -> co_tlbc );
624+ _PyCodeArray * code = _PyCode_GetTLBCArray ( co );
618625 int32_t idx = ((_PyThreadStateImpl * ) tstate )-> tlbc_index ;
619626 if (idx < code -> size && code -> entries [idx ] != NULL ) {
620627 return (_Py_CODEUNIT * ) code -> entries [idx ];
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ _PyFrame_GetBytecode(_PyInterpreterFrame *f)
9494{
9595#ifdef Py_GIL_DISABLED
9696 PyCodeObject * co = _PyFrame_GetCode (f );
97- _PyCodeArray * tlbc = _Py_atomic_load_ptr_acquire ( & co -> co_tlbc );
97+ _PyCodeArray * tlbc = _PyCode_GetTLBCArray ( co );
9898 assert (f -> tlbc_index >= 0 && f -> tlbc_index < tlbc -> size );
9999 return (_Py_CODEUNIT * )tlbc -> entries [f -> tlbc_index ];
100100#else
You can’t perform that action at this time.
0 commit comments