• Jeremy Hylton's avatar
    Better fix for core dumps on recursive objects in fast mode. · 499ab6a6
    Jeremy Hylton yazdı
    Raise ValueError when an object contains an arbitrarily nested
    reference to itself.  (The previous fix just produced invalid
    pickles.)
    
    Solution is very much like Py_ReprEnter() and Py_ReprLeave():
    fast_save_enter() and fast_save_leave() that tracks the fast_container
    limit and keeps a fast_memo of objects currently being pickled.
    
    The cost of the solution is moderately expensive for deeply nested
    structures, but it still seems to be faster than normal pickling,
    based on tests with deeply nested lists.
    
    Once FAST_LIMIT is exceeded, the new code is about twice as slow as
    fast-mode code that doesn't check for recursion.  It's still twice as
    fast as the normal pickling code.  In the absence of deeply nested
    structures, I couldn't measure a difference.
    499ab6a6
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
acconfig.h Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...