You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dynamic borrow checking currently uses Rust static global data to store the currently active borrows which means that it is limited to checking the borrows by a single statically linked extension but not e.g. across two separate extensions using rust-numpy.
I think the best way to mitigate this is to use a capsule API providing a C API/ABI for the basic borrow checking operations with the global state being attached to a Python module, e.g. an attribute named _BORROW_CHECK_API injected into the numpy.core.multiarray module. This would enable both multiple extensions using rust-numpy to share borrow checking data as well as extensions written in other languages to participate in borrow checking.
The text was updated successfully, but these errors were encountered:
The dynamic borrow checking currently uses Rust
static
global data to store the currently active borrows which means that it is limited to checking the borrows by a single statically linked extension but not e.g. across two separate extensions usingrust-numpy
.I think the best way to mitigate this is to use a capsule API providing a C API/ABI for the basic borrow checking operations with the global state being attached to a Python module, e.g. an attribute named
_BORROW_CHECK_API
injected into thenumpy.core.multiarray
module. This would enable both multiple extensions usingrust-numpy
to share borrow checking data as well as extensions written in other languages to participate in borrow checking.The text was updated successfully, but these errors were encountered: