gh-118527: Intern code consts in free-threaded build (#118667)

We already intern and immortalize most string constants. In the
free-threaded build, other constants can be a source of reference count
contention because they are shared by all threads running the same code
objects.
This commit is contained in:
Sam Gross 2024-05-06 20:12:39 -04:00 committed by GitHub
parent 8d8275b0cf
commit 723d4d2fe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 375 additions and 18 deletions

View file

@ -2621,6 +2621,12 @@ PySet_Clear(PyObject *set)
return 0;
}
void
_PySet_ClearInternal(PySetObject *so)
{
(void)set_clear_internal(so);
}
int
PySet_Contains(PyObject *anyset, PyObject *key)
{