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
While the GIL is held when the API pointer is updated, this can still race with
other threads checking the current value of the API pointer (without holding the
GIL) and should therefore using atomics.
The loads and stores are performed using acquire-release semantics as we want to
dereference the pointer and hence any stores to the referenced memory need to be
visible to us.
The get function should also be unsafe as the offset it uses cannot be verified
which might create an invalid pointer invoking undefined behaviour as per the
contract of pointer::offset.
Finally, the initialization code is moved into a separate cold function to
improve code locality for the fast path.
0 commit comments