summaryrefslogtreecommitdiff
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-02-06 13:33:44 +0000
committerChristian Heimes <christian@cheimes.de>2008-02-06 13:33:44 +0000
commit5b970ad483332dc6c5f3e84a238317d45f844421 (patch)
tree753dc573beb62ee375d27ebdb8ed58a24683dda2 /Objects/classobject.c
parent6075a82243c7646dcdd45b424cf3e5c676f31ccf (diff)
downloadcpython-git-5b970ad483332dc6c5f3e84a238317d45f844421.tar.gz
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/classobject.c')
-rw-r--r--Objects/classobject.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index a9e8c6a9ea..759027bb93 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -9,7 +9,9 @@
*/
static PyMethodObject *free_list;
static int numfree = 0;
-#define MAXFREELIST 256
+#ifndef PyMethod_MAXFREELIST
+#define PyMethod_MAXFREELIST 256
+#endif
#define TP_DESCR_GET(t) \
(PyType_HasFeature(t, Py_TPFLAGS_HAVE_CLASS) ? (t)->tp_descr_get : NULL)
@@ -2337,7 +2339,7 @@ instancemethod_dealloc(register PyMethodObject *im)
Py_DECREF(im->im_func);
Py_XDECREF(im->im_self);
Py_XDECREF(im->im_class);
- if (numfree < MAXFREELIST) {
+ if (numfree < PyMethod_MAXFREELIST) {
im->im_self = (PyObject *)free_list;
free_list = im;
numfree++;