summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-02-04 18:00:12 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-02-04 18:00:12 (GMT)
commit422051a3675271e179995ad4a0f056ff94395d55 (patch)
tree3316e9503901082cc4beefbf169d8191c9838190 /Include
parenta26cf9b7609fc1c08fd1a69ddf5e44dc98a70dce (diff)
downloadcpython-422051a3675271e179995ad4a0f056ff94395d55.zip
cpython-422051a3675271e179995ad4a0f056ff94395d55.tar.gz
cpython-422051a3675271e179995ad4a0f056ff94395d55.tar.bz2
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.h2
-rw-r--r--Include/intobject.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/Include/floatobject.h b/Include/floatobject.h
index 1f4510b..0e5f6a9 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 51d3e1b..7b50525 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