Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add some TODO comments.
  • Loading branch information
ericsnowcurrently committed Mar 22, 2023
commit 3c007c09531121ae5fef7b73c2499df5254ad4b4
6 changes: 6 additions & 0 deletions Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -14611,17 +14611,23 @@ PyUnicode_InternInPlace(PyObject **p)
PyObject *interned = get_interned_dict();
assert(interned != NULL);

// XXX Swap to the main interpreter.

PyObject *t = PyDict_SetDefault(interned, s, s);
if (t == NULL) {
PyErr_Clear();
return;
}

// XXX Swap back.

if (t != s) {
Py_SETREF(*p, Py_NewRef(t));
return;
}

// XXX Immortalize the object.

/* The two references in interned dict (key and value) are not counted by
refcnt. unicode_dealloc() and _PyUnicode_ClearInterned() take care of
this. */
Expand Down