[Python-checkins] r56556 - python/branches/cpy_merge/Modules/_picklemodule.c

alexandre.vassalotti python-checkins at python.org
Thu Jul 26 23:06:04 CEST 2007


Author: alexandre.vassalotti
Date: Thu Jul 26 23:06:03 2007
New Revision: 56556

Modified:
   python/branches/cpy_merge/Modules/_picklemodule.c
Log:
Remove refcount micro-optimization in put().

This makes some pickle streams generated by _pickle
unnecessary different the one by pickle.py, which doesn't
support this feature.


Modified: python/branches/cpy_merge/Modules/_picklemodule.c
==============================================================================
--- python/branches/cpy_merge/Modules/_picklemodule.c	(original)
+++ python/branches/cpy_merge/Modules/_picklemodule.c	Thu Jul 26 23:06:03 2007
@@ -221,7 +221,7 @@
         goto nomemory;
     if ((int) (size_t) bigger != bigger)
         goto nomemory;
-    nbytes = (size_t) bigger *sizeof(PyObject *);
+    nbytes = (size_t) bigger * sizeof(PyObject *);
     if (nbytes / sizeof(PyObject *) != (size_t) bigger)
         goto nomemory;
     tmp = realloc(self->data, nbytes);
@@ -702,7 +702,7 @@
 static int
 put(PicklerObject *self, PyObject *ob)
 {
-    if (ob->ob_refcnt < 2 || self->fast)
+    if (self->fast)
         return 0;
 
     return put2(self, ob);


More information about the Python-checkins mailing list