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
This commit is contained in:
Christian Heimes 2008-02-04 18:00:12 +00:00
parent a26cf9b760
commit 422051a367
11 changed files with 160 additions and 42 deletions

View file

@ -59,6 +59,9 @@ PyAPI_FUNC(long) PyInt_GetMax(void);
PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
/* free list api */
PyAPI_FUNC(void) PyInt_CompactFreeList(size_t *, size_t *, size_t *);
#ifdef __cplusplus
}
#endif