Skip to content
Next Next commit
Enable unicode_release_interned() without insure or valgrind.
  • Loading branch information
shihai1991 committed Jun 23, 2020
commit ed3cd983f77707ddbb3cc5df8041e4bb1068c9cb
13 changes: 0 additions & 13 deletions Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -15657,7 +15657,6 @@ PyUnicode_InternFromString(const char *cp)
}


#if defined(WITH_VALGRIND) || defined(__INSURE__)
static void
unicode_release_interned(void)
{
Expand Down Expand Up @@ -15715,7 +15714,6 @@ unicode_release_interned(void)
PyDict_Clear(interned);
Py_CLEAR(interned);
}
#endif


/********************* Unicode Iterator **************************/
Expand Down Expand Up @@ -16206,18 +16204,7 @@ void
_PyUnicode_Fini(PyThreadState *tstate)
{
if (_Py_IsMainInterpreter(tstate)) {
#if defined(WITH_VALGRIND) || defined(__INSURE__)
/* Insure++ is a memory analysis tool that aids in discovering
* memory leaks and other memory problems. On Python exit, the
* interned string dictionaries are flagged as being in use at exit
* (which it is). Under normal circumstances, this is fine because
* the memory will be automatically reclaimed by the system. Under
* memory debugging, it's a huge source of useless noise, so we
* trade off slower shutdown for less distraction in the memory
* reports. -baw
*/
unicode_release_interned();
#endif /* __INSURE__ */

Py_CLEAR(unicode_empty);

Expand Down