From a594bf46ec7c4ad7ecb8f67b195e19b4684f8986 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 1 Dec 1999 09:51:45 +0000 Subject: [PATCH] - added the patch from Carl Nygard which allow impressive speed improvement on dataset with large text pieces, but at the cost of broken binary compatibility and slightly bigger memory usage. Configure with --with-buffers to activate them, they are protected with XML_USE_BUFFER_CONTENT define. - added xmlCleanupPredefinedEntities(), memory allocation cleanup Daniel --- entities.c | 12 ++++++++++++ entities.h | 1 + include/libxml/entities.h | 1 + 3 files changed, 14 insertions(+) diff --git a/entities.c b/entities.c index 78571e02..8818f45a 100644 --- a/entities.c +++ b/entities.c @@ -148,6 +148,18 @@ void xmlInitializePredefinedEntities(void) { } } +/** + * xmlCleanupPredefinedEntities: + * + * Cleanup up the predefined entities table. + */ +void xmlCleanupPredefinedEntities(void) { + if (xmlPredefinedEntities == NULL) return; + + xmlFreeEntitiesTable(xmlPredefinedEntities); + xmlPredefinedEntities = NULL; +} + /** * xmlGetPredefinedEntity: * @name: the entity name diff --git a/entities.h b/entities.h index 67180b1b..858662ff 100644 --- a/entities.h +++ b/entities.h @@ -88,6 +88,7 @@ void xmlFreeEntitiesTable (xmlEntitiesTablePtr table); void xmlDumpEntitiesTable (xmlBufferPtr buf, xmlEntitiesTablePtr table); xmlEntitiesTablePtr xmlCopyEntitiesTable (xmlEntitiesTablePtr table); +void xmlCleanupPredefinedEntities(void); #ifdef __cplusplus } diff --git a/include/libxml/entities.h b/include/libxml/entities.h index 67180b1b..858662ff 100644 --- a/include/libxml/entities.h +++ b/include/libxml/entities.h @@ -88,6 +88,7 @@ void xmlFreeEntitiesTable (xmlEntitiesTablePtr table); void xmlDumpEntitiesTable (xmlBufferPtr buf, xmlEntitiesTablePtr table); xmlEntitiesTablePtr xmlCopyEntitiesTable (xmlEntitiesTablePtr table); +void xmlCleanupPredefinedEntities(void); #ifdef __cplusplus }