summaryrefslogtreecommitdiff
path: root/Objects/methodobject.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/methodobject.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/methodobject.c')
-rw-r--r--Objects/methodobject.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 17e905be4b..0d9cf1cc48 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -9,7 +9,9 @@
*/
static PyCFunctionObject *free_list = NULL;
static int numfree = 0;
-#define MAXFREELIST 256
+#ifndef PyCFunction_MAXFREELIST
+#define PyCFunction_MAXFREELIST 256
+#endif
PyObject *
PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
@@ -131,7 +133,7 @@ meth_dealloc(PyCFunctionObject *m)
_PyObject_GC_UNTRACK(m);
Py_XDECREF(m->m_self);
Py_XDECREF(m->m_module);
- if (numfree < MAXFREELIST) {
+ if (numfree < PyCFunction_MAXFREELIST) {
m->m_self = (PyObject *)free_list;
free_list = m;
numfree++;