optimization when freeing hash tables. some tuning of buffer allocations
* dict.c hash.c: optimization when freeing hash tables.
* parser.c xmlIO.c include/libxml/tree.h: some tuning of buffer
allocations
* parser.c parserInternals.c include/libxml/parser.h: keep a
single allocated block for all the attributes callbacks,
avoid useless malloc()/free()
* tree.c: do not realloc() when growing a buffer if the buffer
ain't full, malloc/memcpy/free avoid copying memory.
Daniel
diff --git a/parserInternals.c b/parserInternals.c
index 5c85cbc..ea0a5d0 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -2218,6 +2218,8 @@
else
memcpy(ctxt->sax, &xmlDefaultSAXHandler, sizeof(xmlSAXHandler));
+ ctxt->maxatts = 0;
+ ctxt->atts = NULL;
/* Allocate the Input stack */
ctxt->inputTab = (xmlParserInputPtr *)
xmlMalloc(5 * sizeof(xmlParserInputPtr));
@@ -2369,6 +2371,7 @@
xmlFree(ctxt->sax);
if (ctxt->directory != NULL) xmlFree((char *) ctxt->directory);
if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
+ if (ctxt->atts != NULL) xmlFree(ctxt->atts);
if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
#ifdef LIBXML_CATALOG_ENABLED
if (ctxt->catalogs != NULL)