Patch #1953
I implemented the function sys._compact_freelists() and C API functions PyInt_/PyFloat_CompactFreeList() to compact the pre-allocated blocks of ints and floats. They allow the user to reduce the memory usage of a Python process that deals with lots of numbers.
The patch also renames sys._cleartypecache to sys._clear_type_cache
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 72d1039..b6aa96b 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -710,7 +710,7 @@
sys.path_importer_cache.update(pic)
# clear type cache
- sys._cleartypecache()
+ sys._clear_type_cache()
# Clear ABC registries, restoring previously saved ABC registries.
for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: