diff options
author | Christian Heimes <christian@cheimes.de> | 2008-02-04 18:00:12 +0000 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-02-04 18:00:12 +0000 |
commit | d7db458014e9456580d846f6188454b00f2b610f (patch) | |
tree | da4642378e7a7f848739b3d82b5229f5f57657bf /Include | |
parent | ae3f9034720552567405b974b607b05d03ce316e (diff) | |
download | cpython-d7db458014e9456580d846f6188454b00f2b610f.tar.gz |
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
Diffstat (limited to 'Include')
-rw-r--r-- | Include/floatobject.h | 2 | ||||
-rw-r--r-- | Include/intobject.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Include/floatobject.h b/Include/floatobject.h index 1f4510b6ce..0e5f6a9472 100644 --- a/Include/floatobject.h +++ b/Include/floatobject.h @@ -101,6 +101,8 @@ PyAPI_FUNC(void) _PyFloat_DigitsInit(void); PyAPI_FUNC(double) _PyFloat_Unpack4(const unsigned char *p, int le); PyAPI_FUNC(double) _PyFloat_Unpack8(const unsigned char *p, int le); +/* free list api */ +PyAPI_FUNC(void) PyFloat_CompactFreeList(size_t *, size_t *, size_t *); #ifdef __cplusplus } diff --git a/Include/intobject.h b/Include/intobject.h index 51d3e1bfa9..7b5052553e 100644 --- a/Include/intobject.h +++ b/Include/intobject.h @@ -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 |