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/dict.c b/dict.c
index 1002234..eaa4006 100644
--- a/dict.c
+++ b/dict.c
@@ -232,7 +232,7 @@
if (dict == NULL)
return;
if (dict->dict) {
- for(i = 0; i < dict->size; i++) {
+ for(i = 0; ((i < dict->size) && (dict->nbElems > 0)); i++) {
iter = &(dict->dict[i]);
if (iter->valid == 0)
continue;
@@ -243,6 +243,7 @@
xmlFree(iter->name);
if (!inside_dict)
xmlFree(iter);
+ dict->nbElems--;
inside_dict = 0;
iter = next;
}