gh-100227: Revert gh-102925 "gh-100227: Make the Global Interned Dict Safe for Isolated Interpreters" (gh-103063)

This reverts commit 87be8d9.

This approach to keeping the interned strings safe is turning out to be too complex for my taste (due to obmalloc isolation). For now I'm going with the simpler solution, making the dict per-interpreter. We can revisit that later if we want a sharing solution.
This commit is contained in:
Eric Snow 2023-03-27 16:53:05 -06:00 committed by GitHub
parent 34eb6f7276
commit 89e67ada69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 204 deletions

View file

@ -14609,11 +14609,16 @@ PyUnicode_InternInPlace(PyObject **p)
}
PyObject *interned = get_interned_dict();
PyObject *t = _Py_AddToGlobalDict(interned, s, s);
assert(interned != NULL);
PyObject *t = PyDict_SetDefault(interned, s, s);
if (t == NULL) {
PyErr_Clear();
return;
}
if (t != s) {
if (t != NULL) {
Py_SETREF(*p, Py_NewRef(t));
}
Py_SETREF(*p, Py_NewRef(t));
return;
}