mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-36356: Release Unicode interned strings on Valgrind (#12431)
When Python is compiled with Valgrind support, release Unicode interned strings at exit in _PyUnicode_Fini(). * Rename _Py_ReleaseInternedUnicodeStrings() to unicode_release_interned() and make it private. * unicode_release_interned() is now called from _PyUnicode_Fini(): it must be called with a running Python thread state for TRASHCAN, it cannot be called from pymain_free(). * Don't display statistics on interned strings at exit anymore
This commit is contained in:
parent
a712679a2b
commit
fecc4f2b47
3 changed files with 42 additions and 29 deletions
|
|
@ -839,18 +839,6 @@ pymain_free(void)
|
|||
_PyPathConfig_ClearGlobal();
|
||||
_Py_ClearStandardStreamEncoding();
|
||||
_Py_ClearArgcArgv();
|
||||
#ifdef __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
|
||||
*/
|
||||
_Py_ReleaseInternedUnicodeStrings();
|
||||
#endif /* __INSURE__ */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue