From e83e93e715709bb0d117c5386d89f0e5b08d1484 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sat, 30 Aug 2008 12:52:26 +0000 Subject: make a new kind of buffer where shrinking and adding in head can avoid * include/libxml/tree.h tree.c: make a new kind of buffer where shrinking and adding in head can avoid reallocation or full buffer memmoves * encoding.c xmlIO.c: use the new kind of buffers for output buffers Daniel svn path=/trunk/; revision=3787 --- include/libxml/tree.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libxml/tree.h b/include/libxml/tree.h index 5afac525..6a6a09d9 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -71,9 +71,10 @@ typedef xmlEntity *xmlEntityPtr; */ typedef enum { - XML_BUFFER_ALLOC_DOUBLEIT, - XML_BUFFER_ALLOC_EXACT, - XML_BUFFER_ALLOC_IMMUTABLE + XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */ + XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */ + XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */ + XML_BUFFER_ALLOC_IO /* special allocation scheme used for I/O */ } xmlBufferAllocationScheme; /** @@ -88,6 +89,7 @@ struct _xmlBuffer { unsigned int use; /* The buffer size used */ unsigned int size; /* The buffer size */ xmlBufferAllocationScheme alloc; /* The realloc method */ + xmlChar *contentIO; /* in IO mode we may have a different base */ }; /** -- cgit v1.2.3