@@ -256,7 +256,7 @@ impl BorrowFlags {
256
256
fn acquire ( & self , _py : Python , address : * mut u8 , key : BorrowKey ) -> Result < ( ) , BorrowError > {
257
257
// SAFETY: Having `_py` implies holding the GIL and
258
258
// we are not calling into user code which might re-enter this function.
259
- let borrow_flags = unsafe { BORROW_FLAGS . get ( ) } ;
259
+ let borrow_flags = unsafe { self . get ( ) } ;
260
260
261
261
match borrow_flags. entry ( address) {
262
262
Entry :: Occupied ( entry) => {
@@ -299,7 +299,7 @@ impl BorrowFlags {
299
299
fn release ( & self , _py : Python , address : * mut u8 , key : BorrowKey ) {
300
300
// SAFETY: Having `_py` implies holding the GIL and
301
301
// we are not calling into user code which might re-enter this function.
302
- let borrow_flags = unsafe { BORROW_FLAGS . get ( ) } ;
302
+ let borrow_flags = unsafe { self . get ( ) } ;
303
303
304
304
let same_base_arrays = borrow_flags. get_mut ( & address) . unwrap ( ) ;
305
305
@@ -324,7 +324,7 @@ impl BorrowFlags {
324
324
) -> Result < ( ) , BorrowError > {
325
325
// SAFETY: Having `_py` implies holding the GIL and
326
326
// we are not calling into user code which might re-enter this function.
327
- let borrow_flags = unsafe { BORROW_FLAGS . get ( ) } ;
327
+ let borrow_flags = unsafe { self . get ( ) } ;
328
328
329
329
match borrow_flags. entry ( address) {
330
330
Entry :: Occupied ( entry) => {
@@ -361,7 +361,7 @@ impl BorrowFlags {
361
361
fn release_mut ( & self , _py : Python , address : * mut u8 , key : BorrowKey ) {
362
362
// SAFETY: Having `_py` implies holding the GIL and
363
363
// we are not calling into user code which might re-enter this function.
364
- let borrow_flags = unsafe { BORROW_FLAGS . get ( ) } ;
364
+ let borrow_flags = unsafe { self . get ( ) } ;
365
365
366
366
let same_base_arrays = borrow_flags. get_mut ( & address) . unwrap ( ) ;
367
367
0 commit comments