mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
- added the patch from Carl Nygard <cnygard@bellatlantic.net>
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
This commit is contained in:
16
HTMLtree.c
16
HTMLtree.c
@ -152,7 +152,12 @@ htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
|
||||
xmlChar *buffer;
|
||||
|
||||
/* uses the HTML encoding routine !!!!!!!!!! */
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
|
||||
#else
|
||||
buffer = xmlEncodeEntitiesReentrant(doc,
|
||||
xmlBufferContent(cur->content));
|
||||
#endif
|
||||
if (buffer != NULL) {
|
||||
xmlBufferWriteCHAR(buf, buffer);
|
||||
xmlFree(buffer);
|
||||
@ -163,7 +168,11 @@ htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
|
||||
if (cur->type == HTML_COMMENT_NODE) {
|
||||
if (cur->content != NULL) {
|
||||
xmlBufferWriteChar(buf, "<!--");
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
xmlBufferWriteCHAR(buf, cur->content);
|
||||
#else
|
||||
xmlBufferWriteCHAR(buf, xmlBufferContent(cur->content));
|
||||
#endif
|
||||
xmlBufferWriteChar(buf, "-->");
|
||||
}
|
||||
return;
|
||||
@ -213,7 +222,12 @@ htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
|
||||
if (cur->content != NULL) {
|
||||
xmlChar *buffer;
|
||||
|
||||
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
|
||||
#else
|
||||
buffer = xmlEncodeEntitiesReentrant(doc,
|
||||
xmlBufferContent(cur->content));
|
||||
#endif
|
||||
if (buffer != NULL) {
|
||||
xmlBufferWriteCHAR(buf, buffer);
|
||||
xmlFree(buffer);
|
||||
|
Reference in New Issue
Block a user