mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-128137: Update PyASCIIObject to handle interned field with the atomic operation (gh-128196)
This commit is contained in:
parent
b60044b838
commit
ae23a012e6
3 changed files with 18 additions and 10 deletions
|
@ -15729,7 +15729,7 @@ immortalize_interned(PyObject *s)
|
|||
_Py_DecRefTotal(_PyThreadState_GET());
|
||||
}
|
||||
#endif
|
||||
_PyUnicode_STATE(s).interned = SSTATE_INTERNED_IMMORTAL;
|
||||
FT_ATOMIC_STORE_UINT16_RELAXED(_PyUnicode_STATE(s).interned, SSTATE_INTERNED_IMMORTAL);
|
||||
_Py_SetImmortal(s);
|
||||
}
|
||||
|
||||
|
@ -15848,7 +15848,7 @@ intern_common(PyInterpreterState *interp, PyObject *s /* stolen */,
|
|||
_Py_DecRefTotal(_PyThreadState_GET());
|
||||
#endif
|
||||
}
|
||||
_PyUnicode_STATE(s).interned = SSTATE_INTERNED_MORTAL;
|
||||
FT_ATOMIC_STORE_UINT16_RELAXED(_PyUnicode_STATE(s).interned, SSTATE_INTERNED_MORTAL);
|
||||
|
||||
/* INTERNED_MORTAL -> INTERNED_IMMORTAL (if needed) */
|
||||
|
||||
|
@ -15984,7 +15984,7 @@ _PyUnicode_ClearInterned(PyInterpreterState *interp)
|
|||
Py_UNREACHABLE();
|
||||
}
|
||||
if (!shared) {
|
||||
_PyUnicode_STATE(s).interned = SSTATE_NOT_INTERNED;
|
||||
FT_ATOMIC_STORE_UINT16_RELAXED(_PyUnicode_STATE(s).interned, SSTATE_NOT_INTERNED);
|
||||
}
|
||||
}
|
||||
#ifdef INTERNED_STATS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue