_Py_atomic_add_uint16(&tp->tp_versions_used, 1);
}
#endif
- FT_ATOMIC_STORE_UINT32_RELAXED(tp->tp_version_tag, version);
+ FT_ATOMIC_STORE_UINT_RELAXED(tp->tp_version_tag, version);
#ifndef Py_GIL_DISABLED
if (version != 0) {
PyTypeObject **slot =
We don't assign new version tags eagerly, but only as
needed.
*/
- if (FT_ATOMIC_LOAD_UINT_RELAXED(type->tp_version_tag) == 0) {
+ ASSERT_TYPE_LOCK_HELD();
+ if (type->tp_version_tag == 0) {
return;
}
// Cannot modify static builtin types.
PyType_Modified(PyTypeObject *type)
{
// Quick check without the lock held
- if (type->tp_version_tag == 0) {
+ if (FT_ATOMIC_LOAD_UINT_RELAXED(type->tp_version_tag) == 0) {
return;
}