diff options
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/c-api/float.rst | 9 | ||||
| -rw-r--r-- | Doc/c-api/int.rst | 9 | ||||
| -rw-r--r-- | Doc/library/sys.rst | 24 |
3 files changed, 40 insertions, 2 deletions
diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 505c19e151..bb4f74a35e 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -84,3 +84,12 @@ Floating Point Objects Return the minimum normalized positive float *DBL_MIN* as C :ctype:`double`. .. versionadded:: 2.6 + + +.. cfunction:: void PyFloat_CompactFreeList(size_t *bc, size_t *bf, size_t *sum) + + 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. + + .. versionadded:: 2.6 diff --git a/Doc/c-api/int.rst b/Doc/c-api/int.rst index 526083b83b..94bf380ec3 100644 --- a/Doc/c-api/int.rst +++ b/Doc/c-api/int.rst @@ -120,3 +120,12 @@ Plain Integer Objects Return the system's idea of the largest integer it can handle (:const:`LONG_MAX`, as defined in the system header files). + + +.. cfunction:: void PyInt_CompactFreeList(size_t *bc, size_t *bf, size_t *sum) + + 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. + + .. versionadded:: 2.6 diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 7c88251523..17e3890a90 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -58,9 +58,29 @@ always available. A string containing the copyright pertaining to the Python interpreter. -.. function:: _cleartypecache() +.. function:: _compact_freelists() - Clear the internal type lookup cache. + 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 + and method lookups. Use the function *only* to drop unnecessary references + during reference leak debugging. + + This function should be used for internal and specialized purposes only. .. versionadded:: 2.6 |
