diff options
author | Barry Warsaw <barry@python.org> | 2001-12-21 20:04:22 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-12-21 20:04:22 (GMT) |
commit | 52acb49298fd0aee8a2a2a352f0b2ab039649bde (patch) | |
tree | 8494a3378452f85b4b71a0e02bc6c63cc21f8bec /Modules | |
parent | 87fa3aa12cbb24c89cfb13c16d04f46a2dd9a9e1 (diff) | |
download | cpython-52acb49298fd0aee8a2a2a352f0b2ab039649bde.zip cpython-52acb49298fd0aee8a2a2a352f0b2ab039649bde.tar.gz cpython-52acb49298fd0aee8a2a2a352f0b2ab039649bde.tar.bz2 |
Merge of the release22 branch changes back into the trunk.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/cPickle.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c index a4943ce..adf7e44 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -321,7 +321,9 @@ typedef struct Picklerobject { PyObject *fast_memo; } Picklerobject; -#define FAST_LIMIT 2000 +#ifndef PY_CPICKLE_FAST_LIMIT +#define PY_CPICKLE_FAST_LIMIT 50 +#endif staticforward PyTypeObject Picklertype; @@ -891,7 +893,7 @@ static int fast_save_enter(Picklerobject *self, PyObject *obj) { /* if fast_container < 0, we're doing an error exit. */ - if (++self->fast_container >= FAST_LIMIT) { + if (++self->fast_container >= PY_CPICKLE_FAST_LIMIT) { PyObject *key = NULL; if (self->fast_memo == NULL) { self->fast_memo = PyDict_New(); @@ -921,7 +923,7 @@ fast_save_enter(Picklerobject *self, PyObject *obj) int fast_save_leave(Picklerobject *self, PyObject *obj) { - if (self->fast_container-- >= FAST_LIMIT) { + if (self->fast_container-- >= PY_CPICKLE_FAST_LIMIT) { PyObject *key = PyLong_FromVoidPtr(obj); if (key == NULL) return 0; |