summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-07-06 03:35:58 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-07-06 03:35:58 (GMT)
commit2fe77060eb2b322da925b50ffe3c471258736cee (patch)
tree0966f7b98ec52c58f6c58cf42ec75237c72dda0b /Doc
parent17f2e4acb963268fe8b3c4e822f33d9372460607 (diff)
downloadcpython-2fe77060eb2b322da925b50ffe3c471258736cee.zip
cpython-2fe77060eb2b322da925b50ffe3c471258736cee.tar.gz
cpython-2fe77060eb2b322da925b50ffe3c471258736cee.tar.bz2
- Issue #2862: Make int and float freelist management consistent with other
freelists. Changes their CompactFreeList apis into ClearFreeList apis and calls them via gc.collect().
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/float.rst7
-rw-r--r--Doc/c-api/int.rst7
-rw-r--r--Doc/library/gc.rst6
-rw-r--r--Doc/library/sys.rst16
4 files changed, 12 insertions, 24 deletions
diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst
index bb4f74a..f705297 100644
--- a/Doc/c-api/float.rst
+++ b/Doc/c-api/float.rst
@@ -86,10 +86,9 @@ Floating Point Objects
.. versionadded:: 2.6
-.. cfunction:: void PyFloat_CompactFreeList(size_t *bc, size_t *bf, size_t *sum)
+.. cfunction:: int PyFloat_ClearFreeList(void)
- Compact the float free list. *bc* is the number of allocated blocks before
- blocks are freed, *bf* is the number of freed blocks and *sum* is the number
- of remaining objects in the blocks.
+ Clear the float free list. Return the number of items that could not
+ be freed.
.. versionadded:: 2.6
diff --git a/Doc/c-api/int.rst b/Doc/c-api/int.rst
index 94bf380..ef82100 100644
--- a/Doc/c-api/int.rst
+++ b/Doc/c-api/int.rst
@@ -122,10 +122,9 @@ Plain Integer Objects
(:const:`LONG_MAX`, as defined in the system header files).
-.. cfunction:: void PyInt_CompactFreeList(size_t *bc, size_t *bf, size_t *sum)
+.. cfunction:: int PyInt_ClearFreeList(void)
- Compact the integer free list. *bc* is the number of allocated blocks before
- blocks are freed, *bf* is the number of freed blocks and *sum* is the number
- of remaining objects in the blocks.
+ Clear the integer free list. Return the number of items that could not
+ be freed.
.. versionadded:: 2.6
diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst
index 70e4a6b..9ebbf06 100644
--- a/Doc/library/gc.rst
+++ b/Doc/library/gc.rst
@@ -47,6 +47,12 @@ The :mod:`gc` module provides the following functions:
.. versionchanged:: 2.5
The optional *generation* argument was added.
+ .. versionchanged:: 2.6
+ The free lists maintained for a number of builtin types are cleared
+ whenever a full collection or collection of the highest generation (2)
+ is run. Not all items in some free lists may be freed due to the
+ particular implementation, in particular :class:`int` and :class:`float`.
+
.. function:: set_debug(flags)
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 2e39633..22397f2 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -58,22 +58,6 @@ always available.
A string containing the copyright pertaining to the Python interpreter.
-.. function:: _compact_freelists()
-
- Compact the free lists of integers and floats by deallocating unused blocks.
- It can reduce the memory usage of the Python process several tenth of
- thousands of integers or floats have been allocated at once.
-
- The return value is a tuple of tuples each containing three elements,
- amount of used objects, total block count before the blocks are deallocated
- and amount of freed blocks. The first tuple refers to ints, the second to
- floats.
-
- This function should be used for specialized purposes only.
-
- .. versionadded:: 2.6
-
-
.. function:: _clear_type_cache()
Clear the internal type cache. The type cache is used to speed up attribute