Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4df762f

Browse files
committed
Insure properly identifies the `interned' dictionary as leaking at
shutdown time, but CVS log entry for revision 2.45 explains why this is so. Simply include a comment so we don't have to re-figure it out again 5 years from now.
1 parent f2581c9 commit 4df762f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Objects/stringobject.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,6 +2850,18 @@ PyString_Format(PyObject *format, PyObject *args)
28502850

28512851
#ifdef INTERN_STRINGS
28522852

2853+
/* This dictionary will leak at PyString_Fini() time. That's acceptable
2854+
* because PyString_Fini() specifically frees interned strings that are
2855+
* only referenced by this dictionary. The CVS log entry for revision 2.45
2856+
* says:
2857+
*
2858+
* Change the Fini function to only remove otherwise unreferenced
2859+
* strings from the interned table. There are references in
2860+
* hard-to-find static variables all over the interpreter, and it's not
2861+
* worth trying to get rid of all those; but "uninterning" isn't fair
2862+
* either and may cause subtle failures later -- so we have to keep them
2863+
* in the interned table.
2864+
*/
28532865
static PyObject *interned;
28542866

28552867
void

0 commit comments

Comments
 (0)