mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +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:
@@ -229,6 +229,24 @@ typedef struct xmlRef {
|
||||
} xmlRef;
|
||||
typedef xmlRef *xmlRefPtr;
|
||||
|
||||
/*
|
||||
* A buffer structure
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
XML_BUFFER_ALLOC_DOUBLEIT,
|
||||
XML_BUFFER_ALLOC_EXACT
|
||||
} xmlBufferAllocationScheme;
|
||||
|
||||
typedef struct xmlBuffer {
|
||||
xmlChar *content; /* The buffer content UTF8 */
|
||||
unsigned int use; /* The buffer size used */
|
||||
unsigned int size; /* The buffer size */
|
||||
xmlBufferAllocationScheme alloc; /* The realloc method */
|
||||
} _xmlBuffer;
|
||||
typedef _xmlBuffer xmlBuffer;
|
||||
typedef xmlBuffer *xmlBufferPtr;
|
||||
|
||||
/*
|
||||
* A node in an XML tree.
|
||||
*/
|
||||
@@ -248,7 +266,11 @@ typedef struct xmlNode {
|
||||
const xmlChar *name; /* the name of the node, or the entity */
|
||||
xmlNs *ns; /* pointer to the associated namespace */
|
||||
xmlNs *nsDef; /* namespace definitions on this node */
|
||||
#ifndef XML_USE_BUFFER_CONTENT
|
||||
xmlChar *content; /* the content */
|
||||
#else
|
||||
xmlBufferPtr content; /* the content in a buffer */
|
||||
#endif
|
||||
} _xmlNode;
|
||||
typedef _xmlNode xmlNode;
|
||||
typedef _xmlNode *xmlNodePtr;
|
||||
@@ -277,30 +299,20 @@ typedef struct xmlDoc {
|
||||
typedef _xmlDoc xmlDoc;
|
||||
typedef xmlDoc *xmlDocPtr;
|
||||
|
||||
/*
|
||||
* A buffer structure
|
||||
*/
|
||||
|
||||
typedef struct xmlBuffer {
|
||||
xmlChar *content; /* The buffer content UTF8 */
|
||||
unsigned int use; /* The buffer size used */
|
||||
unsigned int size; /* The buffer size */
|
||||
} _xmlBuffer;
|
||||
typedef _xmlBuffer xmlBuffer;
|
||||
typedef xmlBuffer *xmlBufferPtr;
|
||||
|
||||
/*
|
||||
* Variables.
|
||||
*/
|
||||
extern xmlNsPtr baseDTD;
|
||||
extern int oldXMLWDcompatibility;/* maintain compatibility with old WD */
|
||||
extern int xmlIndentTreeOutput; /* try to indent the tree dumps */
|
||||
extern xmlBufferAllocationScheme xmlBufferAllocScheme; /* alloc scheme to use */
|
||||
|
||||
/*
|
||||
* Handling Buffers.
|
||||
*/
|
||||
|
||||
xmlBufferPtr xmlBufferCreate (void);
|
||||
xmlBufferPtr xmlBufferCreateSize (size_t size);
|
||||
void xmlBufferFree (xmlBufferPtr buf);
|
||||
int xmlBufferDump (FILE *file,
|
||||
xmlBufferPtr buf);
|
||||
@@ -314,6 +326,11 @@ void xmlBufferCCat (xmlBufferPtr buf,
|
||||
int xmlBufferShrink (xmlBufferPtr buf,
|
||||
int len);
|
||||
void xmlBufferEmpty (xmlBufferPtr buf);
|
||||
const xmlChar* xmlBufferContent (const xmlBufferPtr buf);
|
||||
int xmlBufferUse (const xmlBufferPtr buf);
|
||||
void xmlBufferSetAllocationScheme(xmlBufferPtr buf,
|
||||
xmlBufferAllocationScheme scheme);
|
||||
int xmlBufferLength (const xmlBufferPtr buf);
|
||||
|
||||
/*
|
||||
* Creating/freeing new structures
|
||||
|
Reference in New Issue
Block a user