summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #19972: Add rarely used freefunc. This fixes a leak if sys.exit()Stefan Krah2013-12-141-8/+14
| | | | is used in a program.
* Issue #6784: Strings from Python 2 can now be unpickled as bytes objects.Alexandre Vassalotti2013-12-071-189/+217
| | | | | | | Initial patch by Merlijn van Deen. I've added a few unrelated docstring fixes in the patch while I was at it, which makes the documentation for pickle a bit more consistent.
* Issue #19881: Fix bad pickling of large bytes in cpickle.Alexandre Vassalotti2013-12-061-1/+1
|
* Issue #6477: Merge with 3.3.Alexandre Vassalotti2013-12-011-2/+2
|\
| * Issue #6477: Keep PyNotImplemented_Type and PyNone_Type private.Alexandre Vassalotti2013-12-011-2/+2
| |
* | Issue #6477: Merge with 3.3.Alexandre Vassalotti2013-12-011-1/+31
|\ \ | |/
| * Issue #6477: Added support for pickling the types of built-in singletons.Alexandre Vassalotti2013-12-011-1/+31
| |
* | Merge with 3.3.Alexandre Vassalotti2013-11-301-1/+1
|\ \ | |/
| * Fixed _pickle.Unpickler to handle empty persistent IDs correctly.Alexandre Vassalotti2013-11-301-1/+1
| |
* | Issue #17897: Optimized unpickle prefetching.Serhiy Storchaka2013-11-301-30/+22
| |
* | Use PyDict_GetItemWithError instead of PyDict_GetItem in cpickle.Alexandre Vassalotti2013-11-291-12/+35
| |
* | Remove explicit empty tuple reuse in cpickle.Alexandre Vassalotti2013-11-281-12/+6
| | | | | | | | | | | | PyTuple_New(0) always returns the same empty tuple from its free list anyway, so we are not saving much here. Plus, the code where this was used is on uncommon run paths.
* | Remove the tuple reuse optimization in _Pickle_FastCall.Alexandre Vassalotti2013-11-281-30/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I have noticed a race-condition occurring on one of the buildbots because of this optimization. The function called may release the GIL which means multiple threads may end up accessing the shared tuple. I could fix it up by storing the tuple to the Pickler and Unipickler object again, but honestly it really not worth the trouble. I ran many benchmarks and the only time the optimization helps is when using a fin-memory file, like io.BytesIO on which reads are super cheap, combined with pickle protocol less than 4. Even in this contrived case, the speedup is a about 5%. For everything else, this optimization does not provide any noticable improvements.
* | Encapsulate cpickle global state in a dedicated object.Alexandre Vassalotti2013-11-281-270/+426
| | | | | | | | | | This implements PEP 3121 module finalization as well. This change does not cause any significant impact on performance.
* | Combine the FastCall functions in cpickle.Alexandre Vassalotti2013-11-271-90/+42
| | | | | | | | | | I fixed the bug that was in my previous attempt of this cleanup. I ran the full test suite to verify I didn't introduce any obvious bugs.
* | Reverting e39db21df580 eagerly due to buildbot failures.Alexandre Vassalotti2013-11-251-33/+90
| |
* | Combine _Pickler_FastCall and _Unpickler_FastCall in cpickle.Alexandre Vassalotti2013-11-251-90/+33
| |
* | Issue #19739: Try to fix compiler warnings on 32-bit Windows.Alexandre Vassalotti2013-11-251-22/+21
| |
* | Merge save_int into save_long in cpickle to remove redundant code.Alexandre Vassalotti2013-11-251-53/+33
| | | | | | | | Also, replace unnessary uses of the #if preprocessor directive.
* | Simplify save_bool in cpickle.Alexandre Vassalotti2013-11-251-18/+11
| |
* | Use Clinic to process arguments in cpickle.Alexandre Vassalotti2013-11-241-257/+672
| | | | | | | | | | | | This doesn't make any functional changes to the exisiting implementation. The conversion did help however uncover documentation bugs. The best thing about this conversion is less C code to maintain by hand.
* | Remove code path in cpickle that does not exist in pickle.Alexandre Vassalotti2013-11-241-7/+1
| |
* | Make Ellipsis and NotImplemented picklable through the reduce protocol.Alexandre Vassalotti2013-11-241-32/+0
| |
* | Make built-in methods picklable through the reduce protocol.Alexandre Vassalotti2013-11-241-32/+0
| |
* | Make framing optional in pickle protocol 4.Alexandre Vassalotti2013-11-241-126/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow us to control in the future whether to use framing or not. For example, we may want to turn it off for tiny pickle where it doesn't help. The change also improves performance slightly: ### fastpickle ### Min: 0.608517 -> 0.557358: 1.09x faster Avg: 0.798892 -> 0.694738: 1.15x faster Significant (t=3.45) Stddev: 0.17145 -> 0.12704: 1.3496x smaller Timeline: http://goo.gl/3xQE1J ### pickle_dict ### Min: 0.669920 -> 0.615271: 1.09x faster Avg: 0.733633 -> 0.645058: 1.14x faster Significant (t=5.05) Stddev: 0.12041 -> 0.02961: 4.0662x smaller Timeline: http://goo.gl/LpLSXI ### pickle_list ### Min: 0.397583 -> 0.368112: 1.08x faster Avg: 0.412784 -> 0.397223: 1.04x faster Significant (t=2.78) Stddev: 0.01518 -> 0.03653: 2.4068x larger Timeline: http://goo.gl/v39E59 ### unpickle_list ### Min: 0.692935 -> 0.594870: 1.16x faster Avg: 0.730012 -> 0.628395: 1.16x faster Significant (t=17.76) Stddev: 0.02720 -> 0.02995: 1.1012x larger Timeline: http://goo.gl/2P9AEt The following not significant results are hidden, use -v to show them: fastunpickle.
* | Fix signed / unsigned comparisonAntoine Pitrou2013-11-231-1/+1
| |
* | gcc doesn't realize that dummy is always initialized by the function callGregory P. Smith2013-11-231-1/+1
| | | | | | | | | | and warns about potential uninitialized use. Silence that by initializing it to null.
* | Issue #17810: Add two missing error checks to save_globalChristian Heimes2013-11-231-2/+4
| | | | | | | | CID 1131946: Unchecked return value (CHECKED_RETURN)
* | MergeAntoine Pitrou2013-11-231-1/+1
|\ \
| * | Issue #17810: return -1 on errorChristian Heimes2013-11-231-1/+1
| | |
* | | Fix writing out 64-bit size fields on 32-bit buildsAntoine Pitrou2013-11-231-11/+21
|/ /
* | Issue #17810: Add NULL check to save_frozensetChristian Heimes2013-11-231-0/+3
| | | | | | | | CID 1131949: Dereference null return value (NULL_RETURNS)
* | Issue #17810: Implement PEP 3154, pickle protocol 4.Antoine Pitrou2013-11-231-367/+1013
| | | | | | | | Most of the work is by Alexandre.
* | Issue #19437: Use an identifier for "__name__" string in pickle to improveVictor Stinner2013-11-141-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | error handling The following code didn't handle correctly the failure of PyUnicode_InternFromString("__name__"). if (newobj_str == NULL) { newobj_str = PyUnicode_InternFromString("__newobj__"); name_str = PyUnicode_InternFromString("__name__"); if (newobj_str == NULL || name_str == NULL) return -1; }
* | Issue #19512: pickle now uses an identifier to only create the Unicode stringVictor Stinner2013-11-061-2/+4
| | | | | | | | "modules" once
* | Issue #19437: Fix _pickle, don't call _Unpickler_SkipConsumed() with anVictor Stinner2013-10-311-3/+3
| | | | | | | | exception set
* | cleanup _Unpickler_SkipConsumed(): remove 1 level of indentationVictor Stinner2013-10-311-12/+15
| |
* | Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-7/+7
|\ \ | |/ | | | | error messages and comments.
| * Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-7/+7
| | | | | | | | error messages and comments.
* | Issue #18559: Fix NULL pointer dereference error in _pickle moduleChristian Heimes2013-07-261-4/+6
|\ \ | |/
| * Issue #18559: Fix NULL pointer dereference error in _pickle moduleChristian Heimes2013-07-261-4/+6
| |
* | Issue #18408: handle PySys_GetObject() failure, raise a RuntimeErrorVictor Stinner2013-07-161-2/+6
| |
* | Issue #18408: _pickle.c: Add missing PyErr_NoMemory() on memory allocation ↵Victor Stinner2013-07-111-2/+7
| | | | | | | | failures
* | Issue #18408: _PyMemoTable_ResizeTable() now restores the old table ifVictor Stinner2013-07-111-1/+1
| | | | | | | | | | | | allocating a bigger table failed PyMemoTable destructor does crash if mt_table is NULL.
* | Issue #18408: Oh, I was wrong: Pickler_New() must call Py_DECREF() to destroyVictor Stinner2013-07-111-1/+1
| | | | | | | | the newly created pickler, and not PyObject_GC_Del().
* | Issue #18408: Fix _Pickler_New() and _Unpickler_New(): initialize allVictor Stinner2013-07-111-22/+14
| | | | | | | | | | | | | | | | | | attributes before handling errors _Pickler_New() now calls PyObject_GC_Del() instead of Py_DECREF() on error, because the pickle object is created using PyObject_GC_New(). Fix a crash in the destructor when an attribute is not initiallized.
* | Issue #18203: Add _PyMem_RawStrdup() and _PyMem_Strdup()Victor Stinner2013-07-071-6/+6
| | | | | | | | | | Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the GIL is held or not.
* | Singular form just like the other error message.Christian Heimes2013-07-011-1/+1
|\ \ | |/
| * Singular form just like the other error message.Christian Heimes2013-07-011-1/+1
| |
* | Issue #18339: Negative ints keys in unpickler.memo dict no longer cause aChristian Heimes2013-07-011-0/+5
|\ \ | |/ | | | | segfault inside the _pickle C extension.