@@ -1066,7 +1066,7 @@ _PyType_SetVersion(PyTypeObject *tp, unsigned int version)
1066
1066
* slot = NULL ;
1067
1067
}
1068
1068
#endif
1069
- tp -> tp_version_tag = version ;
1069
+ FT_ATOMIC_STORE_UINT32_RELAXED ( tp -> tp_version_tag , version ) ;
1070
1070
#ifndef Py_GIL_DISABLED
1071
1071
if (version != 0 ) {
1072
1072
PyTypeObject * * slot =
@@ -1104,7 +1104,6 @@ _PyType_LookupByVersion(unsigned int version)
1104
1104
PyTypeObject * * slot =
1105
1105
interp -> types .type_version_cache
1106
1106
+ (version % TYPE_VERSION_CACHE_SIZE );
1107
- printf ("slot: %p\n" , slot );
1108
1107
if (* slot && (* slot )-> tp_version_tag == version ) {
1109
1108
return * slot ;
1110
1109
}
@@ -1149,8 +1148,6 @@ assign_version_tag(PyInterpreterState *interp, PyTypeObject *type)
1149
1148
return 0 ;
1150
1149
}
1151
1150
_PyType_SetVersion (type , NEXT_GLOBAL_VERSION_TAG ++ );
1152
- // FT_ATOMIC_STORE_UINT32_RELAXED(type->tp_version_tag,
1153
- // NEXT_GLOBAL_VERSION_TAG++);
1154
1151
assert (type -> tp_version_tag <= _Py_MAX_GLOBAL_TYPE_VERSION_TAG );
1155
1152
}
1156
1153
else {
@@ -1160,8 +1157,6 @@ assign_version_tag(PyInterpreterState *interp, PyTypeObject *type)
1160
1157
return 0 ;
1161
1158
}
1162
1159
_PyType_SetVersion (type , NEXT_VERSION_TAG (interp )++ );
1163
- // FT_ATOMIC_STORE_UINT32_RELAXED(type->tp_version_tag,
1164
- // NEXT_VERSION_TAG(interp)++);
1165
1160
assert (type -> tp_version_tag != 0 );
1166
1161
}
1167
1162
0 commit comments