This is my first cut at adding a XML_ParserReset
function. My idea was to reset the parser to a state
that was almost identical to what it is after
XML_ParserCreate() except that any allocated memory is
preserved. As this patch is currently, I think it
misght still has some potential problems with dtdInit
() and possibly internalEncoding and setContext().
But for my documents/application it seems to work
great. It passes Purify without any memory leaks and
when parsing 5000 documents, I only get ~40 memory
allocations instead of ~200,000 :)
The function declartion needed for expat.h:
/* Resets an existing parser to a state comparable to
XML_ParserCreate but preserves any allocated
XML_ParserReset(XML_Parser parser, const XML_Char
Log in to post a comment.