diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-08-19 15:01:28 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-08-19 15:01:28 +0000 |
commit | 6155d8aafa3cc60b5fdaaf75b423e489ea8280c4 (patch) | |
tree | 82892b7f88bac3a8d21786fe679abcb4b0a3cfa8 /dict.c | |
parent | 66f68e716ba29bf333cb0c83d401b7a06afe2197 (diff) | |
download | android_external_libxml2-6155d8aafa3cc60b5fdaaf75b423e489ea8280c4.tar.gz android_external_libxml2-6155d8aafa3cc60b5fdaaf75b423e489ea8280c4.tar.bz2 android_external_libxml2-6155d8aafa3cc60b5fdaaf75b423e489ea8280c4.zip |
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
Diffstat (limited to 'dict.c')
-rw-r--r-- | dict.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -232,7 +232,7 @@ xmlDictFree(xmlDictPtr dict) { 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 @@ xmlDictFree(xmlDictPtr dict) { xmlFree(iter->name); if (!inside_dict) xmlFree(iter); + dict->nbElems--; inside_dict = 0; iter = next; } |