_Py_ReleaseInternedStrings(): Private API function to decref and
release the interned string dictionary. This is useful for memory
use debugging because it eliminates a huge source of noise from the
reports. Only defined when INTERN_STRINGS is defined.
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index 9cf64ba..740cbe2 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -3217,3 +3217,13 @@
}
#endif
}
+
+#ifdef INTERN_STRINGS
+void _Py_ReleaseInternedStrings(void)
+{
+ if (interned) {
+ Py_DECREF(interned);
+ interned = NULL;
+ }
+}
+#endif /* INTERN_STRINGS */