pickle complexity limit?
Paul Rubin
http
Tue Nov 11 11:47:01 EST 2003
martin at v.loewis.de (Martin v. Löwis) writes:
> > I wonder if it's feasible to write a pickler as a C extension that
> > works something like a pointer-reversing garbage collector,
> > eliminating the need for recursion and still not needing any extra
> > storage in the objects.
>
> You definitely will need storage, to remember the objects you have to
> come back to; you won't necessarily need storage *in the objects*.
No. I'm talking about a crazy hack that was used in some old-time
Lisp systems. The idea is to temporarily reverse the pointers that
already exist in the objects to track what's been GC'd, so you don't
need more than a constant amount of additional storage. Google for
"Deutsch Schorr Waite garbage collection" or look in Knuth vol 1 for
more info.
More information about the Python-list
mailing list