-
Couldn't load subscription status.
- Fork 135
Open
Description
The py_capsule and py_capsule_fn macros generate code that cache the pointer obtained from a capsule in a static mut item, with a std::sync::Once in a second static item for thread-safety.
Although the synchronization cost of Once is small, it seems unnecessary here since code touching this is always holding the GIL. Could this cache be implemented with a single static item of type cpython::GILProtected<std::cell::Cell<_>> instead?
Metadata
Metadata
Assignees
Labels
No labels