summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-02-06 13:33:44 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-02-06 13:33:44 (GMT)
commit5b970ad483332dc6c5f3e84a238317d45f844421 (patch)
tree753dc573beb62ee375d27ebdb8ed58a24683dda2 /Objects/frameobject.c
parent6075a82243c7646dcdd45b424cf3e5c676f31ccf (diff)
downloadcpython-5b970ad483332dc6c5f3e84a238317d45f844421.zip
cpython-5b970ad483332dc6c5f3e84a238317d45f844421.tar.gz
cpython-5b970ad483332dc6c5f3e84a238317d45f844421.tar.bz2
Unified naming convention for free lists and their limits. All free lists
in Object/ are named ``free_list``, the counter ``numfree`` and the upper limit is a macro ``PyName_MAXFREELIST`` inside an #ifndef block. The chances should make it easier to adjust Python for platforms with less memory, e.g. mobile phones.
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r--Objects/frameobject.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index be00caa..df9c2e0 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -393,14 +393,15 @@ static PyGetSetDef frame_getsetlist[] = {
call depth of more than 20 or 30 is probably already exceptional
unless the program contains run-away recursion. I hope.
- Later, MAXFREELIST was added to bound the # of frames saved on
+ Later, PyFrame_MAXFREELIST was added to bound the # of frames saved on
free_list. Else programs creating lots of cyclic trash involving
frames could provoke free_list into growing without bound.
*/
static PyFrameObject *free_list = NULL;
static int numfree = 0; /* number of frames currently in free_list */
-#define MAXFREELIST 200 /* max value for numfree */
+/* max value for numfree */
+#define PyFrame_MAXFREELIST 200
static void
frame_dealloc(PyFrameObject *f)
@@ -433,7 +434,7 @@ frame_dealloc(PyFrameObject *f)
co = f->f_code;
if (co->co_zombieframe == NULL)
co->co_zombieframe = f;
- else if (numfree < MAXFREELIST) {
+ else if (numfree < PyFrame_MAXFREELIST) {
++numfree;
f->f_back = free_list;
free_list = f;