Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Borrow checking should use a capsule API #359

Closed
adamreichold opened this issue Nov 8, 2022 · 0 comments · Fixed by #361
Closed

Borrow checking should use a capsule API #359

adamreichold opened this issue Nov 8, 2022 · 0 comments · Fixed by #361

Comments

@adamreichold
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant