@@ -1409,7 +1409,7 @@ PyUnicode_New(Py_ssize_t size, Py_UCS4 maxchar)
14091409 data = unicode + 1 ;
14101410 _PyUnicode_LENGTH (unicode ) = size ;
14111411 _PyUnicode_HASH (unicode ) = -1 ;
1412- _PyUnicode_STATE (unicode ). interned = 0 ;
1412+ _PyASCIIObject_CAST (unicode )-> interned = 0 ;
14131413 _PyUnicode_STATE (unicode ).kind = kind ;
14141414 _PyUnicode_STATE (unicode ).compact = 1 ;
14151415 _PyUnicode_STATE (unicode ).ascii = is_ascii ;
@@ -1711,7 +1711,7 @@ unicode_dealloc(PyObject *unicode)
17111711 _Py_SetImmortal (unicode );
17121712 return ;
17131713 }
1714- switch (_PyUnicode_STATE (unicode ). interned ) {
1714+ switch (_PyASCIIObject_CAST (unicode )-> interned ) {
17151715 case SSTATE_NOT_INTERNED :
17161716 break ;
17171717 case SSTATE_INTERNED_MORTAL :
@@ -1739,7 +1739,7 @@ unicode_dealloc(PyObject *unicode)
17391739 // so it can't cause trouble (except wasted memory)
17401740 // - if it wasn't popped, it'll remain interned
17411741 _Py_SetImmortal (unicode );
1742- _PyUnicode_STATE (unicode ). interned = SSTATE_INTERNED_IMMORTAL ;
1742+ _PyASCIIObject_CAST (unicode )-> interned = SSTATE_INTERNED_IMMORTAL ;
17431743 return ;
17441744 }
17451745 if (r == 0 ) {
@@ -15470,7 +15470,7 @@ unicode_subtype_new(PyTypeObject *type, PyObject *unicode)
1547015470#else
1547115471 _PyUnicode_HASH (self ) = _PyUnicode_HASH (unicode );
1547215472#endif
15473- _PyUnicode_STATE (self ). interned = 0 ;
15473+ _PyASCIIObject_CAST (self )-> interned = 0 ;
1547415474 _PyUnicode_STATE (self ).kind = kind ;
1547515475 _PyUnicode_STATE (self ).compact = 0 ;
1547615476 _PyUnicode_STATE (self ).ascii = _PyUnicode_STATE (unicode ).ascii ;
@@ -15689,7 +15689,7 @@ intern_static(PyInterpreterState *interp, PyObject *s /* stolen */)
1568915689 assert (r == NULL );
1569015690 /* but just in case (for the non-debug build), handle this */
1569115691 if (r != NULL && r != s ) {
15692- assert (_PyUnicode_STATE (r ). interned == SSTATE_INTERNED_IMMORTAL_STATIC );
15692+ assert (_PyASCIIObject_CAST (r )-> interned == SSTATE_INTERNED_IMMORTAL_STATIC );
1569315693 assert (_PyUnicode_CHECK (r ));
1569415694 Py_DECREF (s );
1569515695 return Py_NewRef (r );
@@ -15699,7 +15699,7 @@ intern_static(PyInterpreterState *interp, PyObject *s /* stolen */)
1569915699 Py_FatalError ("failed to intern static string" );
1570015700 }
1570115701
15702- _PyUnicode_STATE (s ). interned = SSTATE_INTERNED_IMMORTAL_STATIC ;
15702+ _PyASCIIObject_CAST (s )-> interned = SSTATE_INTERNED_IMMORTAL_STATIC ;
1570315703 return s ;
1570415704}
1570515705
@@ -15726,7 +15726,7 @@ immortalize_interned(PyObject *s)
1572615726 _Py_DecRefTotal (_PyThreadState_GET ());
1572715727 }
1572815728#endif
15729- _PyUnicode_STATE ( s ). interned = SSTATE_INTERNED_IMMORTAL ;
15729+ FT_ATOMIC_STORE_UINT16_RELAXED ( _PyASCIIObject_CAST ( s ) -> interned , SSTATE_INTERNED_IMMORTAL ) ;
1573015730 _Py_SetImmortal (s );
1573115731}
1573215732
@@ -15833,7 +15833,7 @@ intern_common(PyInterpreterState *interp, PyObject *s /* stolen */,
1583315833
1583415834 /* NOT_INTERNED -> INTERNED_MORTAL */
1583515835
15836- assert (_PyUnicode_STATE (s ). interned == SSTATE_NOT_INTERNED );
15836+ assert (_PyASCIIObject_CAST (s )-> interned == SSTATE_NOT_INTERNED );
1583715837
1583815838 if (!_Py_IsImmortal (s )) {
1583915839 /* The two references in interned dict (key and value) are not counted.
@@ -15845,7 +15845,7 @@ intern_common(PyInterpreterState *interp, PyObject *s /* stolen */,
1584515845 _Py_DecRefTotal (_PyThreadState_GET ());
1584615846#endif
1584715847 }
15848- _PyUnicode_STATE ( s ). interned = SSTATE_INTERNED_MORTAL ;
15848+ FT_ATOMIC_STORE_UINT16_RELAXED ( _PyASCIIObject_CAST ( s ) -> interned , SSTATE_INTERNED_MORTAL ) ;
1584915849
1585015850 /* INTERNED_MORTAL -> INTERNED_IMMORTAL (if needed) */
1585115851
@@ -15981,7 +15981,7 @@ _PyUnicode_ClearInterned(PyInterpreterState *interp)
1598115981 Py_UNREACHABLE ();
1598215982 }
1598315983 if (!shared ) {
15984- _PyUnicode_STATE ( s ). interned = SSTATE_NOT_INTERNED ;
15984+ FT_ATOMIC_STORE_UINT16_RELAXED ( _PyASCIIObject_CAST ( s ) -> interned , SSTATE_NOT_INTERNED ) ;
1598515985 }
1598615986 }
1598715987#ifdef INTERNED_STATS
0 commit comments