mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
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:
parent
34eb6f7276
commit
89e67ada69
7 changed files with 30 additions and 204 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue