On Mon, 20 Oct 2003, Melvin Smith wrote: > At 04:38 PM 10/20/2003 -0400, Dan Sugalski wrote: > >The encoding methods for freezing (and corresponding decoding methods for > >thawing) may be overridden to provide an alternate serialization format. > >The only requirement of the serialziation format is that it starts with a > >minimally valid piece of XML that encodes the format and version of the > >serialized format. The rest of the serialization format need not be XML. > >This is done because the format and version of the serialized data are > >required in the stream, and making it XML incoveniences nobody and makes > >the XML folks happy. It's good enough, and not up for discussion. > > Does that mean all encodings will start with the "standard" markup header: > > <xml version="1.0"?>
Each serialized data stream, yeah. Just once, and probably a few extra characters in there, to make it legit XML. Definitely not once per object, just once per stream--if you do: freeze S3, P5 and P5 happens to have a PMC that points to your top level symbol table, the string in S3 will be darned huge, and have the <XML foo=?> thing in there exactly once. (Well, unless you've chosen an XML encoding, in which case I expect you've just blown memory... :) Dan