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.
diff --git a/Objects/classobject.c b/Objects/classobject.c
index a9e8c6a..759027b 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 @@
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++;