diff Objects/methodobject.c @ 45191:920a7633ae08 legacy-trunk

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.
author Christian Heimes <christian@cheimes.de>
date Wed, 06 Feb 2008 13:33:44 +0000
parents a4c87c889648
children 65ae68c7aca3
line wrap: on
line diff
--- a/Objects/methodobject.c	Wed Feb 06 12:44:34 2008 +0000
+++ b/Objects/methodobject.c	Wed Feb 06 13:33:44 2008 +0000
@@ -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 @@
 	_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++;