libxml2 r3820 - trunk



Author: veillard
Date: Mon Mar 23 19:32:04 2009
New Revision: 3820
URL: http://svn.gnome.org/viewvc/libxml2?rev=3820&view=rev

Log:
* tree.c: add a missing check in xmlAddSibling, patch by Kris Breuker
* xmlIO.c: avoid xmlAllocOutputBuffer using XML_BUFFER_EXACT which
  leads to performances problems especially on Windows.
daniel


Modified:
   trunk/ChangeLog
   trunk/tree.c
   trunk/xmlIO.c

Modified: trunk/tree.c
==============================================================================
--- trunk/tree.c	(original)
+++ trunk/tree.c	Mon Mar 23 19:32:04 2009
@@ -3103,6 +3103,14 @@
 	return(NULL);
     }
 
+    if (cur == elem) {
+#ifdef DEBUG_TREE
+        xmlGenericError(xmlGenericErrorContext,
+		"xmlAddSibling : cur == elem\n");
+#endif
+	return(NULL);
+    }
+
     /*
      * Constant time is we can rely on the ->parent->last to find
      * the last sibling.

Modified: trunk/xmlIO.c
==============================================================================
--- trunk/xmlIO.c	(original)
+++ trunk/xmlIO.c	Mon Mar 23 19:32:04 2009
@@ -2278,6 +2278,10 @@
 	return(NULL);
     }
 
+    /* try to avoid a performance problem with Windows realloc() */
+    if (ret->buffer->alloc == XML_BUFFER_ALLOC_EXACT)
+        ret->buffer->alloc = XML_BUFFER_ALLOC_DOUBLEIT;
+
     ret->encoder = encoder;
     if (encoder != NULL) {
         ret->conv = xmlBufferCreateSize(4000);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]