diff options
author | Christian Heimes <christian@cheimes.de> | 2008-02-06 13:33:44 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-02-06 13:33:44 (GMT) |
commit | 5b970ad483332dc6c5f3e84a238317d45f844421 (patch) | |
tree | 753dc573beb62ee375d27ebdb8ed58a24683dda2 /Objects/methodobject.c | |
parent | 6075a82243c7646dcdd45b424cf3e5c676f31ccf (diff) | |
download | cpython-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/methodobject.c')
-rw-r--r-- | Objects/methodobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 17e905b..0d9cf1c 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++; |